summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLibravatar Michael Haggerty <mhagger@alum.mit.edu>2015-05-25 18:39:15 +0000
committerLibravatar Junio C Hamano <gitster@pobox.com>2015-05-25 12:19:38 -0700
commitc50fb6cee6627ab9355e2d1e09fcab9dfe92cdb7 (patch)
treedbb2322beff8af266d9868b2db46c27d77d22acc
parentmark_complete(): rewrite to take an object_id argument (diff)
downloadtgif-c50fb6cee6627ab9355e2d1e09fcab9dfe92cdb7.tar.xz
clear_marks(): 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>
-rw-r--r--fetch-pack.c13
1 files changed, 5 insertions, 8 deletions
diff --git a/fetch-pack.c b/fetch-pack.c
index 5380b1b8c1..1e875cf06d 100644
--- a/fetch-pack.c
+++ b/fetch-pack.c
@@ -70,9 +70,10 @@ static int rev_list_insert_ref(const char *refname, const unsigned char *sha1, i
return 0;
}
-static int clear_marks(const char *refname, const unsigned char *sha1, int flag, void *cb_data)
+static int clear_marks(const char *refname, const struct object_id *oid,
+ int flag, void *cb_data)
{
- struct object *o = deref_tag(parse_object(sha1), refname, 0);
+ struct object *o = deref_tag(parse_object(oid->hash), refname, 0);
if (o && o->type == OBJ_COMMIT)
clear_commit_marks((struct commit *)o,
@@ -261,12 +262,8 @@ static int find_common(struct fetch_pack_args *args,
if (args->stateless_rpc && multi_ack == 1)
die("--stateless-rpc requires multi_ack_detailed");
- if (marked) {
- struct each_ref_fn_sha1_adapter wrapped_clear_marks =
- {clear_marks, NULL};
-
- for_each_ref(each_ref_fn_adapter, &wrapped_clear_marks);
- }
+ if (marked)
+ for_each_ref(clear_marks, NULL);
marked = 1;
for_each_ref(each_ref_fn_adapter, &wrapped_rev_list_insert_ref);