Skip to content

Commit

Permalink
mark_complete_oid(): new function, taking an object_oid
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Michael Haggerty authored and Junio C Hamano committed May 25, 2015
1 parent c50fb6c commit f8ee4d8
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions fetch-pack.c
Original file line number Diff line number Diff line change
Expand Up @@ -490,6 +490,12 @@ static int mark_complete(const char *refname, const unsigned char *sha1, int fla
return 0;
}

static int mark_complete_oid(const char *refname, const struct object_id *oid,
int flag, void *cb_data)
{
return mark_complete(refname, oid->hash, flag, cb_data);
}

static void mark_recent_complete_commits(struct fetch_pack_args *args,
unsigned long cutoff)
{
Expand Down Expand Up @@ -602,10 +608,7 @@ static int everything_local(struct fetch_pack_args *args,
}

if (!args->depth) {
struct each_ref_fn_sha1_adapter wrapped_mark_complete =
{mark_complete, NULL};

for_each_ref(each_ref_fn_adapter, &wrapped_mark_complete);
for_each_ref(mark_complete_oid, NULL);
for_each_alternate_ref(mark_alternate_complete, NULL);
commit_list_sort_by_date(&complete);
if (cutoff)
Expand Down

0 comments on commit f8ee4d8

Please sign in to comment.