mark_complete_oid(): new function, taking an object_oid
This function can be used with for_each_ref() without having to be wrapped. 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>
Michael Haggerty committed
May 25, 2015 at 18:39 UTC
f8ee4d85229a26ec6d4ce403d953eea6b53c6396
1 file changed
+7
-4
fetch-pack.c
+7
-4
@@ -490,6 +490,12 @@ static int mark_complete(const char *refname, const unsigned char *sha1, int fla
490
return 0;
491
}
492
493
+static int mark_complete_oid(const char *refname, const struct object_id *oid,
494
+ int flag, void *cb_data)
495
+{
496
+ return mark_complete(refname, oid->hash, flag, cb_data);
497
+}
498
+
499
static void mark_recent_complete_commits(struct fetch_pack_args *args,
500
unsigned long cutoff)
501
{
@@ -602,10 +608,7 @@ static int everything_local(struct fetch_pack_args *args,
608
}
609
610
if (!args->depth) {
605
- struct each_ref_fn_sha1_adapter wrapped_mark_complete =
606
- {mark_complete, NULL};
607
-
608
- for_each_ref(each_ref_fn_adapter, &wrapped_mark_complete);
611
+ for_each_ref(mark_complete_oid, NULL);
612
for_each_alternate_ref(mark_alternate_complete, NULL);
613
commit_list_sort_by_date(&complete);
614
if (cutoff)