mark_complete(): 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>
Michael Haggerty committed
May 25, 2015 at 18:39 UTC
b4ebaf9eea30a38a0462ff72ea3e0aec0101bb7e
1 file changed
+5
-6
walker.c
+5
-6
@@ -200,9 +200,11 @@ static int interpret_target(struct walker *walker, char *target, unsigned char *
200
return -1;
201
}
202
203
-static int mark_complete(const char *path, const unsigned char *sha1, int flag, void *cb_data)
203
+static int mark_complete(const char *path, const struct object_id *oid,
204
+ int flag, void *cb_data)
205
{
205
- struct commit *commit = lookup_commit_reference_gently(sha1, 1);
206
+ struct commit *commit = lookup_commit_reference_gently(oid->hash, 1);
207
+
208
if (commit) {
209
commit->object.flags |= COMPLETE;
210
commit_list_insert(commit, &complete);
@@ -269,10 +271,7 @@ int walker_fetch(struct walker *walker, int targets, char **target,
271
}
272
273
if (!walker->get_recover) {
272
- struct each_ref_fn_sha1_adapter wrapped_mark_complete =
273
- {mark_complete, NULL};
274
-
275
- for_each_ref(each_ref_fn_adapter, &wrapped_mark_complete);
274
+ for_each_ref(mark_complete, NULL);
275
commit_list_sort_by_date(&complete);
276
}
277