Rename this function and convert it to take a pointer to struct object_id. This is a prerequisite for converting get_reference, which is needed to convert parse_object. Signed-off-by: brian m. carlson <sandals@xxxxxxxxxxxxxxxxxxxx> --- builtin/am.c | 2 +- builtin/checkout.c | 4 ++-- revision.c | 8 ++++---- revision.h | 6 +++--- 4 files changed, 10 insertions(+), 10 deletions(-) diff --git a/builtin/am.c b/builtin/am.c index 7663f12e6..642d7047d 100644 --- a/builtin/am.c +++ b/builtin/am.c @@ -1618,7 +1618,7 @@ static int fall_back_threeway(const struct am_state *state, const char *index_pa init_revisions(&rev_info, NULL); rev_info.diffopt.output_format = DIFF_FORMAT_NAME_STATUS; diff_opt_parse(&rev_info.diffopt, &diff_filter_str, 1, rev_info.prefix); - add_pending_sha1(&rev_info, "HEAD", our_tree.hash, 0); + add_pending_oid(&rev_info, "HEAD", &our_tree, 0); diff_setup_done(&rev_info.diffopt); run_diff_index(&rev_info, 1); } diff --git a/builtin/checkout.c b/builtin/checkout.c index afa99fb8a..7f1eeea94 100644 --- a/builtin/checkout.c +++ b/builtin/checkout.c @@ -721,7 +721,7 @@ static int add_pending_uninteresting_ref(const char *refname, const struct object_id *oid, int flags, void *cb_data) { - add_pending_sha1(cb_data, refname, oid->hash, UNINTERESTING); + add_pending_oid(cb_data, refname, oid, UNINTERESTING); return 0; } @@ -807,7 +807,7 @@ static void orphaned_commit_warning(struct commit *old, struct commit *new) add_pending_object(&revs, object, oid_to_hex(&object->oid)); for_each_ref(add_pending_uninteresting_ref, &revs); - add_pending_sha1(&revs, "HEAD", new->object.oid.hash, UNINTERESTING); + add_pending_oid(&revs, "HEAD", &new->object.oid, UNINTERESTING); refs = revs.pending; revs.leak_pending = 1; diff --git a/revision.c b/revision.c index c2091b6de..f82c56e1f 100644 --- a/revision.c +++ b/revision.c @@ -203,10 +203,10 @@ static struct object *get_reference(struct rev_info *revs, const char *name, return object; } -void add_pending_sha1(struct rev_info *revs, const char *name, - const unsigned char *sha1, unsigned int flags) +void add_pending_oid(struct rev_info *revs, const char *name, + const struct object_id *oid, unsigned int flags) { - struct object *object = get_reference(revs, name, sha1, flags); + struct object *object = get_reference(revs, name, oid->hash, flags); add_pending_object(revs, object, name); } @@ -1159,7 +1159,7 @@ static int handle_one_ref(const char *path, const struct object_id *oid, object = get_reference(cb->all_revs, path, oid->hash, cb->all_flags); add_rev_cmdline(cb->all_revs, object, path, REV_CMD_REF, cb->all_flags); - add_pending_sha1(cb->all_revs, path, oid->hash, cb->all_flags); + add_pending_oid(cb->all_revs, path, oid, cb->all_flags); return 0; } diff --git a/revision.h b/revision.h index 14886ec92..728425a02 100644 --- a/revision.h +++ b/revision.h @@ -263,9 +263,9 @@ extern void show_object_with_name(FILE *, struct object *, const char *); extern void add_pending_object(struct rev_info *revs, struct object *obj, const char *name); -extern void add_pending_sha1(struct rev_info *revs, - const char *name, const unsigned char *sha1, - unsigned int flags); +extern void add_pending_oid(struct rev_info *revs, + const char *name, const struct object_id *oid, + unsigned int flags); extern void add_head_to_pending(struct rev_info *); extern void add_reflogs_to_pending(struct rev_info *, unsigned int flags);