Skip to content

Commit fcb615f

Browse files
mhaggergitster
authored andcommitted
add_pending_uninteresting_ref(): rewrite to take an object_id argument
Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu> Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
1 parent a55ce97 commit fcb615f

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

builtin/checkout.c

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -702,10 +702,10 @@ static void update_refs_for_switch(const struct checkout_opts *opts,
702702
}
703703

704704
static int add_pending_uninteresting_ref(const char *refname,
705-
const unsigned char *sha1,
705+
const struct object_id *oid,
706706
int flags, void *cb_data)
707707
{
708-
add_pending_sha1(cb_data, refname, sha1, UNINTERESTING);
708+
add_pending_sha1(cb_data, refname, oid->hash, UNINTERESTING);
709709
return 0;
710710
}
711711

@@ -784,16 +784,14 @@ static void orphaned_commit_warning(struct commit *old, struct commit *new)
784784
struct rev_info revs;
785785
struct object *object = &old->object;
786786
struct object_array refs;
787-
struct each_ref_fn_sha1_adapter wrapped_add_pending_uninteresting_ref =
788-
{add_pending_uninteresting_ref, &revs};
789787

790788
init_revisions(&revs, NULL);
791789
setup_revisions(0, NULL, &revs, NULL);
792790

793791
object->flags &= ~UNINTERESTING;
794792
add_pending_object(&revs, object, sha1_to_hex(object->sha1));
795793

796-
for_each_ref(each_ref_fn_adapter, &wrapped_add_pending_uninteresting_ref);
794+
for_each_ref(add_pending_uninteresting_ref, &revs);
797795
add_pending_sha1(&revs, "HEAD", new->object.sha1, UNINTERESTING);
798796

799797
refs = revs.pending;

0 commit comments

Comments
 (0)