From ed1c9977cb1b63e4270ad8bdf967a2d02580aa08 Mon Sep 17 00:00:00 2001 From: "brian m. carlson" Date: Tue, 10 Nov 2015 02:22:29 +0000 Subject: 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 Signed-off-by: Jeff King --- builtin/checkout.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'builtin/checkout.c') 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 %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)); } /* -- cgit v1.2.1