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");
- if (marked)
- for_each_ref(clear_marks, NULL);
+ if (marked) {
+ struct each_ref_fn_sha1_adapter wrapped_clear_marks =
+ {clear_marks, NULL};
+
+ for_each_ref(each_ref_fn_adapter, &wrapped_clear_marks);
+ }
marked = 1;
- for_each_ref(rev_list_insert_ref, NULL);
+ for_each_ref(each_ref_fn_adapter, &wrapped_rev_list_insert_ref);
for_each_alternate_ref(insert_one_alternate_ref, NULL);
fetching = 0;
/* Append unmatched requests to the list */
if (allow_tip_sha1_in_want) {
for (i = 0; i < nr_sought; i++) {
+ unsigned char sha1[20];
+
ref = sought[i];
if (ref->matched)
continue;
- if (get_sha1_hex(ref->name, ref->old_sha1))
+ if (get_sha1_hex(ref->name, sha1) ||
+ ref->name[40] != '\0' ||
+ hashcmp(sha1, ref->old_sha1))
continue;
ref->matched = 1;
- *newtail = ref;
- ref->next = NULL;
- newtail = &ref->next;
+ *newtail = copy_ref(ref);
+ newtail = &(*newtail)->next;
}
}
*refs = newlist;
}
if (!args->depth) {
- for_each_ref(mark_complete, NULL);
+ struct each_ref_fn_sha1_adapter wrapped_mark_complete =
+ {mark_complete, NULL};
+
+ for_each_ref(each_ref_fn_adapter, &wrapped_mark_complete);
for_each_alternate_ref(mark_alternate_complete, NULL);
commit_list_sort_by_date(&complete);
if (cutoff)
for (retval = 1, ref = *refs; ref ; ref = ref->next) {
const unsigned char *remote = ref->old_sha1;
- unsigned char local[20];
struct object *o;
o = lookup_object(remote);
ref->name);
continue;
}
-
- hashcpy(ref->new_sha1, local);
if (!args->verbose)
continue;
fprintf(stderr,