Skip to content

Commit f8ee4d8

Browse files
mhaggergitster
authored andcommitted
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 <[email protected]> Signed-off-by: brian m. carlson <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent c50fb6c commit f8ee4d8

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

fetch-pack.c

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -490,6 +490,12 @@ static int mark_complete(const char *refname, const unsigned char *sha1, int fla
490490
return 0;
491491
}
492492

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+
493499
static void mark_recent_complete_commits(struct fetch_pack_args *args,
494500
unsigned long cutoff)
495501
{
@@ -602,10 +608,7 @@ static int everything_local(struct fetch_pack_args *args,
602608
}
603609

604610
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);
609612
for_each_alternate_ref(mark_alternate_complete, NULL);
610613
commit_list_sort_by_date(&complete);
611614
if (cutoff)

0 commit comments

Comments
 (0)