summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Haggerty <mhagger@alum.mit.edu>2015-05-25 18:39:18 +0000
committerJunio C Hamano <gitster@pobox.com>2015-05-25 12:19:39 -0700
commitb1b49c6eb607b3f5697db7dae51e5152a3af3423 (patch)
treefff3944bc7236c6cda108d3dfc1dd9929d78a1d0
parent6e20a51a8096059ecba6c7959d308c52f9fe8900 (diff)
downloadgit-b1b49c6eb607b3f5697db7dae51e5152a3af3423.tar.gz
rev_list_insert_ref_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>
-rw-r--r--fetch-pack.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/fetch-pack.c b/fetch-pack.c
index 13a5000bfe..28c54c32b1 100644
--- a/fetch-pack.c
+++ b/fetch-pack.c
@@ -70,6 +70,12 @@ static int rev_list_insert_ref(const char *refname, const unsigned char *sha1, i
return 0;
}
+static int rev_list_insert_ref_oid(const char *refname, const struct object_id *oid,
+ int flag, void *cb_data)
+{
+ return rev_list_insert_ref(refname, oid->hash, flag, cb_data);
+}
+
static int clear_marks(const char *refname, const struct object_id *oid,
int flag, void *cb_data)
{
@@ -257,8 +263,6 @@ static int find_common(struct fetch_pack_args *args,
int got_ready = 0;
struct strbuf req_buf = STRBUF_INIT;
size_t state_len = 0;
- struct each_ref_fn_sha1_adapter wrapped_rev_list_insert_ref =
- {rev_list_insert_ref, NULL};
if (args->stateless_rpc && multi_ack == 1)
die("--stateless-rpc requires multi_ack_detailed");
@@ -266,7 +270,7 @@ static int find_common(struct fetch_pack_args *args,
for_each_ref(clear_marks, NULL);
marked = 1;
- for_each_ref(each_ref_fn_adapter, &wrapped_rev_list_insert_ref);
+ for_each_ref(rev_list_insert_ref_oid, NULL);
for_each_alternate_ref(insert_one_alternate_ref, NULL);
fetching = 0;