summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLibravatar brian m. carlson <sandals@crustytoothpaste.net>2015-11-10 02:22:29 +0000
committerLibravatar Jeff King <peff@peff.net>2015-11-20 08:02:05 -0500
commited1c9977cb1b63e4270ad8bdf967a2d02580aa08 (patch)
treef5b52ccae09103672c62c1c11ff0bddc78199829
parentConvert struct object to object_id (diff)
downloadtgif-ed1c9977cb1b63e4270ad8bdf967a2d02580aa08.tar.xz
Remove get_object_hash.
Convert all instances of get_object_hash to use an appropriate reference to the hash member of the oid member of struct object. This provides no functional change, as it is essentially a macro substitution. Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net> Signed-off-by: Jeff King <peff@peff.net>
-rw-r--r--archive.c6
-rw-r--r--bisect.c6
-rw-r--r--branch.c2
-rw-r--r--builtin/blame.c24
-rw-r--r--builtin/branch.c2
-rw-r--r--builtin/checkout.c10
-rw-r--r--builtin/clone.c2
-rw-r--r--builtin/commit.c8
-rw-r--r--builtin/describe.c6
-rw-r--r--builtin/diff-tree.c8
-rw-r--r--builtin/diff.c12
-rw-r--r--builtin/fast-export.c12
-rw-r--r--builtin/fetch.c4
-rw-r--r--builtin/fmt-merge-msg.c4
-rw-r--r--builtin/fsck.c4
-rw-r--r--builtin/grep.c2
-rw-r--r--builtin/index-pack.c2
-rw-r--r--builtin/log.c18
-rw-r--r--builtin/merge-tree.c4
-rw-r--r--builtin/merge.c50
-rw-r--r--builtin/name-rev.c4
-rw-r--r--builtin/notes.c2
-rw-r--r--builtin/pack-objects.c14
-rw-r--r--builtin/pull.c2
-rw-r--r--builtin/reflog.c4
-rw-r--r--builtin/reset.c2
-rw-r--r--builtin/rev-list.c4
-rw-r--r--builtin/rev-parse.c4
-rw-r--r--builtin/show-branch.c4
-rw-r--r--builtin/unpack-objects.c2
-rw-r--r--bundle.c2
-rw-r--r--cache-tree.c2
-rw-r--r--combine-diff.c4
-rw-r--r--commit.c12
-rw-r--r--decorate.c2
-rw-r--r--diff-lib.c2
-rw-r--r--fetch-pack.c4
-rw-r--r--fsck.c6
-rw-r--r--http-push.c20
-rw-r--r--line-log.c6
-rw-r--r--log-tree.c20
-rw-r--r--merge-blobs.c4
-rw-r--r--merge-recursive.c16
-rw-r--r--notes-merge.c20
-rw-r--r--object.c6
-rw-r--r--object.h2
-rw-r--r--pack-bitmap-write.c14
-rw-r--r--pack-bitmap.c26
-rw-r--r--patch-ids.c6
-rw-r--r--pretty.c8
-rw-r--r--ref-filter.c6
-rw-r--r--refs.c2
-rw-r--r--revision.c16
-rw-r--r--sequencer.c18
-rw-r--r--sha1_name.c16
-rw-r--r--shallow.c2
-rw-r--r--submodule.c2
-rw-r--r--tag.c6
-rw-r--r--test-match-trees.c2
-rw-r--r--tree.c4
-rw-r--r--upload-pack.c10
-rw-r--r--walker.c8
-rw-r--r--wt-status.c2
63 files changed, 251 insertions, 253 deletions
diff --git a/archive.c b/archive.c
index af23001b10..0687afae43 100644
--- a/archive.c
+++ b/archive.c
@@ -241,7 +241,7 @@ int write_archive_entries(struct archiver_args *args,
len--;
if (args->verbose)
fprintf(stderr, "%.*s\n", (int)len, args->base);
- err = write_entry(args, get_object_hash(args->tree->object), args->base,
+ err = write_entry(args, args->tree->object.oid.hash, args->base,
len, 040777);
if (err)
return err;
@@ -374,7 +374,7 @@ static void parse_treeish_arg(const char **argv,
commit = lookup_commit_reference_gently(oid.hash, 1);
if (commit) {
- commit_sha1 = get_object_hash(commit->object);
+ commit_sha1 = commit->object.oid.hash;
archive_time = commit->date;
} else {
commit_sha1 = NULL;
@@ -390,7 +390,7 @@ static void parse_treeish_arg(const char **argv,
unsigned int mode;
int err;
- err = get_tree_entry(get_object_hash(tree->object), prefix,
+ err = get_tree_entry(tree->object.oid.hash, prefix,
tree_oid.hash, &mode);
if (err || !S_ISDIR(mode))
die("current working directory is untracked");
diff --git a/bisect.c b/bisect.c
index 54166f008a..42aa7aa6aa 100644
--- a/bisect.c
+++ b/bisect.c
@@ -500,7 +500,7 @@ struct commit_list *filter_skipped(struct commit_list *list,
struct commit_list *next = list->next;
list->next = NULL;
if (0 <= sha1_array_lookup(&skipped_revs,
- get_object_hash(list->item->object))) {
+ list->item->object.oid.hash)) {
if (skipped_first && !*skipped_first)
*skipped_first = 1;
/* Move current to tried list */
@@ -784,7 +784,7 @@ static void check_merge_bases(int no_checkout)
result = get_merge_bases_many(rev[0], rev_nr - 1, rev + 1);
for (; result; result = result->next) {
- const unsigned char *mb = get_object_hash(result->item->object);
+ const unsigned char *mb = result->item->object.oid.hash;
if (!hashcmp(mb, current_bad_oid->hash)) {
handle_bad_merge_base();
} else if (0 <= sha1_array_lookup(&good_revs, mb)) {
@@ -973,7 +973,7 @@ int bisect_next_all(const char *prefix, int no_checkout)
exit(4);
}
- bisect_rev = get_object_hash(revs.commits->item->object);
+ bisect_rev = revs.commits->item->object.oid.hash;
if (!hashcmp(bisect_rev, current_bad_oid->hash)) {
exit_if_skipped_commits(tried, current_bad_oid);
diff --git a/branch.c b/branch.c
index e86564e923..7ff3f20496 100644
--- a/branch.c
+++ b/branch.c
@@ -267,7 +267,7 @@ void create_branch(const char *head,
if ((commit = lookup_commit_reference(sha1)) == NULL)
die(_("Not a valid branch point: '%s'."), start_name);
- hashcpy(sha1, get_object_hash(commit->object));
+ hashcpy(sha1, commit->object.oid.hash);
if (forcing)
snprintf(msg, sizeof msg, "branch: Reset to %s",
diff --git a/builtin/blame.c b/builtin/blame.c
index 28c48bd453..ffb990fadb 100644
--- a/builtin/blame.c
+++ b/builtin/blame.c
@@ -506,7 +506,7 @@ static int fill_blob_sha1_and_mode(struct origin *origin)
{
if (!is_null_sha1(origin->blob_sha1))
return 0;
- if (get_tree_entry(get_object_hash(origin->commit->object),
+ if (get_tree_entry(origin->commit->object.oid.hash,
origin->path,
origin->blob_sha1, &origin->mode))
goto error_out;
@@ -558,10 +558,10 @@ static struct origin *find_origin(struct scoreboard *sb,
diff_setup_done(&diff_opts);
if (is_null_oid(&origin->commit->object.oid))
- do_diff_cache(get_object_hash(parent->tree->object), &diff_opts);
+ do_diff_cache(parent->tree->object.oid.hash, &diff_opts);
else
- diff_tree_sha1(get_object_hash(parent->tree->object),
- get_object_hash(origin->commit->tree->object),
+ diff_tree_sha1(parent->tree->object.oid.hash,
+ origin->commit->tree->object.oid.hash,
"", &diff_opts);
diffcore_std(&diff_opts);
@@ -628,10 +628,10 @@ static struct origin *find_rename(struct scoreboard *sb,
diff_setup_done(&diff_opts);
if (is_null_oid(&origin->commit->object.oid))
- do_diff_cache(get_object_hash(parent->tree->object), &diff_opts);
+ do_diff_cache(parent->tree->object.oid.hash, &diff_opts);
else
- diff_tree_sha1(get_object_hash(parent->tree->object),
- get_object_hash(origin->commit->tree->object),
+ diff_tree_sha1(parent->tree->object.oid.hash,
+ origin->commit->tree->object.oid.hash,
"", &diff_opts);
diffcore_std(&diff_opts);
@@ -1276,10 +1276,10 @@ static void find_copy_in_parent(struct scoreboard *sb,
DIFF_OPT_SET(&diff_opts, FIND_COPIES_HARDER);
if (is_null_oid(&target->commit->object.oid))
- do_diff_cache(get_object_hash(parent->tree->object), &diff_opts);
+ do_diff_cache(parent->tree->object.oid.hash, &diff_opts);
else
- diff_tree_sha1(get_object_hash(parent->tree->object),
- get_object_hash(target->commit->tree->object),
+ diff_tree_sha1(parent->tree->object.oid.hash,
+ target->commit->tree->object.oid.hash,
"", &diff_opts);
if (!DIFF_OPT_TST(&diff_opts, FIND_COPIES_HARDER))
@@ -2077,7 +2077,7 @@ static int read_ancestry(const char *graft_file)
static int update_auto_abbrev(int auto_abbrev, struct origin *suspect)
{
- const char *uniq = find_unique_abbrev(get_object_hash(suspect->commit->object),
+ const char *uniq = find_unique_abbrev(suspect->commit->object.oid.hash,
auto_abbrev);
int len = strlen(uniq);
if (auto_abbrev < len)
@@ -2216,7 +2216,7 @@ static void verify_working_tree_path(struct commit *work_tree, const char *path)
struct commit_list *parents;
for (parents = work_tree->parents; parents; parents = parents->next) {
- const unsigned char *commit_sha1 = get_object_hash(parents->item->object);
+ const unsigned char *commit_sha1 = parents->item->object.oid.hash;
unsigned char blob_sha1[20];
unsigned mode;
diff --git a/builtin/branch.c b/builtin/branch.c
index e17b5ad938..3f6c825db1 100644
--- a/builtin/branch.c
+++ b/builtin/branch.c
@@ -349,7 +349,7 @@ static void add_verbose_info(struct strbuf *out, struct ref_array_item *item,
fill_tracking_info(&stat, refname, filter->verbose > 1);
strbuf_addf(out, " %s %s%s",
- find_unique_abbrev(get_object_hash(item->commit->object), filter->abbrev),
+ find_unique_abbrev(item->commit->object.oid.hash, filter->abbrev),
stat.buf, sub);
strbuf_release(&stat);
strbuf_release(&subject);
diff --git a/builtin/checkout.c b/builtin/checkout.c
index 50fd893f7a..e8110a9243 100644
--- a/builtin/checkout.c
+++ b/builtin/checkout.c
@@ -401,7 +401,7 @@ static void describe_detached_head(const char *msg, struct commit *commit)
if (!parse_commit(commit))
pp_commit_easy(CMIT_FMT_ONELINE, commit, &sb);
fprintf(stderr, "%s %s... %s\n", msg,
- find_unique_abbrev(get_object_hash(commit->object), DEFAULT_ABBREV), sb.buf);
+ find_unique_abbrev(commit->object.oid.hash, DEFAULT_ABBREV), sb.buf);
strbuf_release(&sb);
}
@@ -510,7 +510,7 @@ static int merge_working_tree(const struct checkout_opts *opts,
setup_standard_excludes(topts.dir);
}
tree = parse_tree_indirect(old->commit ?
- get_object_hash(old->commit->object) :
+ old->commit->object.oid.hash :
EMPTY_TREE_SHA1_BIN);
init_tree_desc(&trees[0], tree->buffer, tree->size);
tree = parse_tree_indirect(new->commit->object.oid.hash);
@@ -653,7 +653,7 @@ static void update_refs_for_switch(const struct checkout_opts *opts,
if (!strcmp(new->name, "HEAD") && !new->path && !opts->force_detach) {
/* Nothing to do. */
} else if (opts->force_detach || !new->path) { /* No longer on any branch. */
- update_ref(msg.buf, "HEAD", get_object_hash(new->commit->object), NULL,
+ update_ref(msg.buf, "HEAD", new->commit->object.oid.hash, NULL,
REF_NODEREF, UPDATE_REFS_DIE_ON_ERR);
if (!opts->quiet) {
if (old->path && advice_detached_head)
@@ -704,7 +704,7 @@ static void describe_one_orphan(struct strbuf *sb, struct commit *commit)
{
strbuf_addstr(sb, " ");
strbuf_addstr(sb,
- find_unique_abbrev(get_object_hash(commit->object), DEFAULT_ABBREV));
+ find_unique_abbrev(commit->object.oid.hash, DEFAULT_ABBREV));
strbuf_addch(sb, ' ');
if (!parse_commit(commit))
pp_commit_easy(CMIT_FMT_ONELINE, commit, sb);
@@ -762,7 +762,7 @@ static void suggest_reattach(struct commit *commit, struct rev_info *revs)
" git branch <new-branch-name> %s\n\n",
/* Give ngettext() the count */
lost),
- find_unique_abbrev(get_object_hash(commit->object), DEFAULT_ABBREV));
+ find_unique_abbrev(commit->object.oid.hash, DEFAULT_ABBREV));
}
/*
diff --git a/builtin/clone.c b/builtin/clone.c
index 2cb8cd81fe..a0b3cd9e56 100644
--- a/builtin/clone.c
+++ b/builtin/clone.c
@@ -657,7 +657,7 @@ static void update_head(const struct ref *our, const struct ref *remote,
} else if (our) {
struct commit *c = lookup_commit_reference(our->old_oid.hash);
/* --branch specifies a non-branch (i.e. tags), detach HEAD */
- update_ref(msg, "HEAD", get_object_hash(c->object),
+ update_ref(msg, "HEAD", c->object.oid.hash,
NULL, REF_NODEREF, UPDATE_REFS_DIE_ON_ERR);
} else if (remote) {
/*
diff --git a/builtin/commit.c b/builtin/commit.c
index 795f9d24f2..6aac5e284c 100644
--- a/builtin/commit.c
+++ b/builtin/commit.c
@@ -299,7 +299,7 @@ static void create_base_index(const struct commit *current_head)
opts.dst_index = &the_index;
opts.fn = oneway_merge;
- tree = parse_tree_indirect(get_object_hash(current_head->object));
+ tree = parse_tree_indirect(current_head->object.oid.hash);
if (!tree)
die(_("failed to unpack HEAD tree object"));
parse_tree(tree);
@@ -1766,7 +1766,7 @@ int cmd_commit(int argc, const char **argv, const char *prefix)
if (!transaction ||
ref_transaction_update(transaction, "HEAD", sha1,
current_head
- ? get_object_hash(current_head->object) : null_sha1,
+ ? current_head->object.oid.hash : null_sha1,
0, sb.buf, &err) ||
ref_transaction_commit(transaction, &err)) {
rollback_index_files();
@@ -1793,10 +1793,10 @@ int cmd_commit(int argc, const char **argv, const char *prefix)
cfg = init_copy_notes_for_rewrite("amend");
if (cfg) {
/* we are amending, so current_head is not NULL */
- copy_note_for_rewrite(cfg, get_object_hash(current_head->object), sha1);
+ copy_note_for_rewrite(cfg, current_head->object.oid.hash, sha1);
finish_copy_notes_for_rewrite(cfg, "Notes added by 'git commit --amend'");
}
- run_rewrite_hook(get_object_hash(current_head->object), sha1);
+ run_rewrite_hook(current_head->object.oid.hash, sha1);
}
if (!quiet)
print_summary(prefix, sha1, !current_head);
diff --git a/builtin/describe.c b/builtin/describe.c
index 11f7300aad..8a25abe0a0 100644
--- a/builtin/describe.c
+++ b/builtin/describe.c
@@ -252,14 +252,14 @@ static void describe(const char *arg, int last_one)
if (!cmit)
die(_("%s is not a valid '%s' object"), arg, commit_type);
- n = find_commit_name(get_object_hash(cmit->object));
+ n = find_commit_name(cmit->object.oid.hash);
if (n && (tags || all || n->prio == 2)) {
/*
* Exact match to an existing ref.
*/
display_name(n);
if (longformat)
- show_suffix(0, n->tag ? get_object_hash(*n->tag->tagged) : sha1);
+ show_suffix(0, n->tag ? n->tag->tagged->oid.hash : sha1);
if (dirty)
printf("%s", dirty);
printf("\n");
@@ -380,7 +380,7 @@ static void describe(const char *arg, int last_one)
display_name(all_matches[0].name);
if (abbrev)
- show_suffix(all_matches[0].depth, get_object_hash(cmit->object));
+ show_suffix(all_matches[0].depth, cmit->object.oid.hash);
if (dirty)
printf("%s", dirty);
printf("\n");
diff --git a/builtin/diff-tree.c b/builtin/diff-tree.c
index 6fef266ea3..2a12b81e06 100644
--- a/builtin/diff-tree.c
+++ b/builtin/diff-tree.c
@@ -51,7 +51,7 @@ static int stdin_diff_trees(struct tree *tree1, char *line, int len)
return -1;
printf("%s %s\n", oid_to_hex(&tree1->object.oid),
oid_to_hex(&tree2->object.oid));
- diff_tree_sha1(get_object_hash(tree1->object), get_object_hash(tree2->object),
+ diff_tree_sha1(tree1->object.oid.hash, tree2->object.oid.hash,
"", &log_tree_opt.diffopt);
log_tree_diff_flush(&log_tree_opt);
return 0;
@@ -139,7 +139,7 @@ int cmd_diff_tree(int argc, const char **argv, const char *prefix)
break;
case 1:
tree1 = opt->pending.objects[0].item;
- diff_tree_commit_sha1(get_object_hash(*tree1));
+ diff_tree_commit_sha1(tree1->oid.hash);
break;
case 2:
tree1 = opt->pending.objects[0].item;
@@ -149,8 +149,8 @@ int cmd_diff_tree(int argc, const char **argv, const char *prefix)
tree2 = tree1;
tree1 = tmp;
}
- diff_tree_sha1(get_object_hash(*tree1),
- get_object_hash(*tree2),
+ diff_tree_sha1(tree1->oid.hash,
+ tree2->oid.hash,
"", &opt->diffopt);
log_tree_diff_flush(opt);
break;
diff --git a/builtin/diff.c b/builtin/diff.c
index 1afed8e27e..ed0acca91f 100644
--- a/builtin/diff.c
+++ b/builtin/diff.c
@@ -175,8 +175,8 @@ static int builtin_diff_tree(struct rev_info *revs,
*/
if (ent1->item->flags & UNINTERESTING)
swap = 1;
- sha1[swap] = get_object_hash(*ent0->item);
- sha1[1 - swap] = get_object_hash(*ent1->item);
+ sha1[swap] = ent0->item->oid.hash;
+ sha1[1 - swap] = ent1->item->oid.hash;
diff_tree_sha1(sha1[0], sha1[1], "", &revs->diffopt);
log_tree_diff_flush(revs);
return 0;
@@ -196,8 +196,8 @@ static int builtin_diff_combined(struct rev_info *revs,
if (!revs->dense_combined_merges && !revs->combine_merges)
revs->dense_combined_merges = revs->combine_merges = 1;
for (i = 1; i < ents; i++)
- sha1_array_append(&parents, get_object_hash(*ent[i].item));
- diff_tree_combined(get_object_hash(*ent[0].item), &parents,
+ sha1_array_append(&parents, ent[i].item->oid.hash);
+ diff_tree_combined(ent[0].item->oid.hash, &parents,
revs->dense_combined_merges, revs);
sha1_array_clear(&parents);
return 0;
@@ -395,7 +395,7 @@ int cmd_diff(int argc, const char **argv, const char *prefix)
const char *name = entry->name;
int flags = (obj->flags & UNINTERESTING);
if (!obj->parsed)
- obj = parse_object(get_object_hash(*obj));
+ obj = parse_object(obj->oid.hash);
obj = deref_tag(obj, NULL, 0);
if (!obj)
die(_("invalid object '%s' given."), name);
@@ -408,7 +408,7 @@ int cmd_diff(int argc, const char **argv, const char *prefix)
} else if (obj->type == OBJ_BLOB) {
if (2 <= blobs)
die(_("more than two blobs given: '%s'"), name);
- hashcpy(blob[blobs].sha1, get_object_hash(*obj));
+ hashcpy(blob[blobs].sha1, obj->oid.hash);
blob[blobs].name = name;
blob[blobs].mode = entry->mode;
blobs++;
diff --git a/builtin/fast-export.c b/builtin/fast-export.c
index 1337a2385a..d9ac5d8410 100644
--- a/builtin/fast-export.c
+++ b/builtin/fast-export.c
@@ -562,11 +562,11 @@ static void handle_commit(struct commit *commit, struct rev_info *rev)
get_object_mark(&commit->parents->item->object) != 0 &&
!full_tree) {
parse_commit_or_die(commit->parents->item);
- diff_tree_sha1(get_object_hash(commit->parents->item->tree->object),
- get_object_hash(commit->tree->object), "", &rev->diffopt);
+ diff_tree_sha1(commit->parents->item->tree->object.oid.hash,
+ commit->tree->object.oid.hash, "", &rev->diffopt);
}
else
- diff_root_tree_sha1(get_object_hash(commit->tree->object),
+ diff_root_tree_sha1(commit->tree->object.oid.hash,
"", &rev->diffopt);
/* Export the referenced blobs, and remember the marks. */
@@ -665,7 +665,7 @@ static void handle_tag(const char *name, struct tag *tag)
return;
}
- buf = read_sha1_file(get_object_hash(tag->object), &type, &size);
+ buf = read_sha1_file(tag->object.oid.hash, &type, &size);
if (!buf)
die ("Could not read tag %s", oid_to_hex(&tag->object.oid));
message = memmem(buf, size, "\n\n", 2);
@@ -777,7 +777,7 @@ static struct commit *get_commit(struct rev_cmdline_entry *e, char *full_name)
/* handle nested tags */
while (tag && tag->object.type == OBJ_TAG) {
- parse_object(get_object_hash(tag->object));
+ parse_object(tag->object.oid.hash);
string_list_append(&extra_refs, full_name)->util = tag;
tag = (struct tag *)tag->tagged;
}
@@ -828,7 +828,7 @@ static void get_tags_and_duplicates(struct rev_cmdline_info *info)
case OBJ_COMMIT:
break;
case OBJ_BLOB:
- export_blob(get_object_hash(commit->object));
+ export_blob(commit->object.oid.hash);
continue;
default: /* OBJ_TAG (nested tags) is already handled */
warning("Tag points to object of unexpected type %s, skipping.",
diff --git a/builtin/fetch.c b/builtin/fetch.c
index 471c154c50..c85f3471d4 100644
--- a/builtin/fetch.c
+++ b/builtin/fetch.c
@@ -530,7 +530,7 @@ static int update_local_ref(struct ref *ref,
if (in_merge_bases(current, updated)) {
struct strbuf quickref = STRBUF_INIT;
int r;
- strbuf_add_unique_abbrev(&quickref, get_object_hash(current->object), DEFAULT_ABBREV);
+ strbuf_add_unique_abbrev(&quickref, current->object.oid.hash, DEFAULT_ABBREV);
strbuf_addstr(&quickref, "..");
strbuf_add_unique_abbrev(&quickref, ref->new_oid.hash, DEFAULT_ABBREV);
if ((recurse_submodules != RECURSE_SUBMODULES_OFF) &&
@@ -547,7 +547,7 @@ static int update_local_ref(struct ref *ref,
} else if (force || ref->force) {
struct strbuf quickref = STRBUF_INIT;
int r;
- strbuf_add_unique_abbrev(&quickref, get_object_hash(current->object), DEFAULT_ABBREV);
+ strbuf_add_unique_abbrev(&quickref, current->object.oid.hash, DEFAULT_ABBREV);
strbuf_addstr(&quickref, "...");
strbuf_add_unique_abbrev(&quickref, ref->new_oid.hash, DEFAULT_ABBREV);
if ((recurse_submodules != RECURSE_SUBMODULES_OFF) &&
diff --git a/builtin/fmt-merge-msg.c b/builtin/fmt-merge-msg.c
index 12aba984eb..e5658c320e 100644
--- a/builtin/fmt-merge-msg.c
+++ b/builtin/fmt-merge-msg.c
@@ -568,7 +568,7 @@ static void find_merge_parents(struct merge_parents *result,
if (!parent)
continue;
commit_list_insert(parent, &parents);
- add_merge_parent(result, get_object_hash(*obj), get_object_hash(parent->object));
+ add_merge_parent(result, obj->oid.hash, parent->object.oid.hash);
}
head_commit = lookup_commit(head);
if (head_commit)
@@ -578,7 +578,7 @@ static void find_merge_parents(struct merge_parents *result,
while (parents) {
struct commit *cmit = pop_commit(&parents);
for (i = 0; i < result->nr; i++)
- if (!hashcmp(result->item[i].commit, get_object_hash(cmit->object)))
+ if (!hashcmp(result->item[i].commit, cmit->object.oid.hash))
result->item[i].used = 1;
}
diff --git a/builtin/fsck.c b/builtin/fsck.c
index 7bfb4938fb..55eac756f7 100644
--- a/builtin/fsck.c
+++ b/builtin/fsck.c
@@ -186,7 +186,7 @@ static void check_reachable_object(struct object *obj)
* do a full fsck
*/
if (!(obj->flags & HAS_OBJ)) {
- if (has_sha1_pack(get_object_hash(*obj)))
+ if (has_sha1_pack(obj->oid.hash))
return; /* it is in pack - forget about it */
if (connectivity_only && has_object_file(&obj->oid))
return;
@@ -249,7 +249,7 @@ static void check_unreachable_object(struct object *obj)
if (!(f = fopen(filename, "w")))
die_errno("Could not open '%s'", filename);
if (obj->type == OBJ_BLOB) {
- if (stream_blob_to_fd(fileno(f), get_object_hash(*obj), NULL, 1))
+ if (stream_blob_to_fd(fileno(f), obj->oid.hash, NULL, 1))
die_errno("Could not write '%s'", filename);
} else
fprintf(f, "%s\n", oid_to_hex(&obj->oid));
diff --git a/builtin/grep.c b/builtin/grep.c
index ca3ceea42c..2825453d18 100644
--- a/builtin/grep.c
+++ b/builtin/grep.c
@@ -459,7 +459,7 @@ static int grep_object(struct grep_opt *opt, const struct pathspec *pathspec,
struct object *obj, const char *name, const char *path)
{
if (obj->type == OBJ_BLOB)
- return grep_sha1(opt, get_object_hash(*obj), name, 0, path);
+ return grep_sha1(opt, obj->oid.hash, name, 0, path);
if (obj->type == OBJ_COMMIT || obj->type == OBJ_TREE) {
struct tree_desc tree;
void *data;