Skip to content

Commit b1b49c6

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

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

fetch-pack.c

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,12 @@ static int rev_list_insert_ref(const char *refname, const unsigned char *sha1, i
7070
return 0;
7171
}
7272

73+
static int rev_list_insert_ref_oid(const char *refname, const struct object_id *oid,
74+
int flag, void *cb_data)
75+
{
76+
return rev_list_insert_ref(refname, oid->hash, flag, cb_data);
77+
}
78+
7379
static int clear_marks(const char *refname, const struct object_id *oid,
7480
int flag, void *cb_data)
7581
{
@@ -257,16 +263,14 @@ static int find_common(struct fetch_pack_args *args,
257263
int got_ready = 0;
258264
struct strbuf req_buf = STRBUF_INIT;
259265
size_t state_len = 0;
260-
struct each_ref_fn_sha1_adapter wrapped_rev_list_insert_ref =
261-
{rev_list_insert_ref, NULL};
262266

263267
if (args->stateless_rpc && multi_ack == 1)
264268
die("--stateless-rpc requires multi_ack_detailed");
265269
if (marked)
266270
for_each_ref(clear_marks, NULL);
267271
marked = 1;
268272

269-
for_each_ref(each_ref_fn_adapter, &wrapped_rev_list_insert_ref);
273+
for_each_ref(rev_list_insert_ref_oid, NULL);
270274
for_each_alternate_ref(insert_one_alternate_ref, NULL);
271275

272276
fetching = 0;

0 commit comments

Comments
 (0)