Git fork

refs: add referent to each_ref_fn

Add a parameter to each_ref_fn so that callers to the ref APIs
that use this function as a callback can have acess to the
unresolved value of a symbolic ref.

Signed-off-by: John Cai <johncai86@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

authored by

John Cai and committed by
Junio C Hamano
e8207717 cfd97152

+78 -54
+2 -1
bisect.c
··· 448 clear_commit_weight(&commit_weight); 449 } 450 451 - static int register_ref(const char *refname, const struct object_id *oid, 452 int flags UNUSED, void *cb_data UNUSED) 453 { 454 struct strbuf good_prefix = STRBUF_INIT; ··· 1170 } 1171 1172 static int mark_for_removal(const char *refname, 1173 const struct object_id *oid UNUSED, 1174 int flag UNUSED, void *cb_data) 1175 {
··· 448 clear_commit_weight(&commit_weight); 449 } 450 451 + static int register_ref(const char *refname, const char *referent UNUSED, const struct object_id *oid, 452 int flags UNUSED, void *cb_data UNUSED) 453 { 454 struct strbuf good_prefix = STRBUF_INIT; ··· 1170 } 1171 1172 static int mark_for_removal(const char *refname, 1173 + const char *referent UNUSED, 1174 const struct object_id *oid UNUSED, 1175 int flag UNUSED, void *cb_data) 1176 {
+3 -1
builtin/bisect.c
··· 356 } 357 358 static int inc_nr(const char *refname UNUSED, 359 const struct object_id *oid UNUSED, 360 int flag UNUSED, void *cb_data) 361 { ··· 545 return res; 546 } 547 548 - static int add_bisect_ref(const char *refname, const struct object_id *oid, 549 int flags UNUSED, void *cb) 550 { 551 struct add_bisect_ref_data *data = cb; ··· 1162 } 1163 1164 static int get_first_good(const char *refname UNUSED, 1165 const struct object_id *oid, 1166 int flag UNUSED, void *cb_data) 1167 {
··· 356 } 357 358 static int inc_nr(const char *refname UNUSED, 359 + const char *referent UNUSED, 360 const struct object_id *oid UNUSED, 361 int flag UNUSED, void *cb_data) 362 { ··· 546 return res; 547 } 548 549 + static int add_bisect_ref(const char *refname, const char *referent UNUSED, const struct object_id *oid, 550 int flags UNUSED, void *cb) 551 { 552 struct add_bisect_ref_data *data = cb; ··· 1163 } 1164 1165 static int get_first_good(const char *refname UNUSED, 1166 + const char *referent UNUSED, 1167 const struct object_id *oid, 1168 int flag UNUSED, void *cb_data) 1169 {
+1 -1
builtin/checkout.c
··· 1045 report_tracking(new_branch_info); 1046 } 1047 1048 - static int add_pending_uninteresting_ref(const char *refname, 1049 const struct object_id *oid, 1050 int flags UNUSED, void *cb_data) 1051 {
··· 1045 report_tracking(new_branch_info); 1046 } 1047 1048 + static int add_pending_uninteresting_ref(const char *refname, const char *referent UNUSED, 1049 const struct object_id *oid, 1050 int flags UNUSED, void *cb_data) 1051 {
+1 -1
builtin/describe.c
··· 149 } 150 } 151 152 - static int get_name(const char *path, const struct object_id *oid, 153 int flag UNUSED, void *cb_data UNUSED) 154 { 155 int is_tag = 0;
··· 149 } 150 } 151 152 + static int get_name(const char *path, const char *referent UNUSED, const struct object_id *oid, 153 int flag UNUSED, void *cb_data UNUSED) 154 { 155 int is_tag = 0;
+2 -1
builtin/fetch.c
··· 286 return ent; 287 } 288 289 - static int add_one_refname(const char *refname, 290 const struct object_id *oid, 291 int flag UNUSED, void *cbdata) 292 { ··· 1464 1465 1466 static int add_oid(const char *refname UNUSED, 1467 const struct object_id *oid, 1468 int flags UNUSED, void *cb_data) 1469 {
··· 286 return ent; 287 } 288 289 + static int add_one_refname(const char *refname, const char *referent UNUSED, 290 const struct object_id *oid, 291 int flag UNUSED, void *cbdata) 292 { ··· 1464 1465 1466 static int add_oid(const char *refname UNUSED, 1467 + const char *referent UNUSED, 1468 const struct object_id *oid, 1469 int flags UNUSED, void *cb_data) 1470 {
+2 -2
builtin/fsck.c
··· 521 return 0; 522 } 523 524 - static int fsck_handle_ref(const char *refname, const struct object_id *oid, 525 int flag UNUSED, void *cb_data UNUSED) 526 { 527 struct object *obj; ··· 576 strbuf_worktree_ref(wt, &ref, "HEAD"); 577 fsck_head_link(ref.buf, &head_points_at, &head_oid); 578 if (head_points_at && !is_null_oid(&head_oid)) 579 - fsck_handle_ref(ref.buf, &head_oid, 0, NULL); 580 strbuf_release(&ref); 581 582 if (include_reflogs)
··· 521 return 0; 522 } 523 524 + static int fsck_handle_ref(const char *refname, const char *referent UNUSED, const struct object_id *oid, 525 int flag UNUSED, void *cb_data UNUSED) 526 { 527 struct object *obj; ··· 576 strbuf_worktree_ref(wt, &ref, "HEAD"); 577 fsck_head_link(ref.buf, &head_points_at, &head_oid); 578 if (head_points_at && !is_null_oid(&head_oid)) 579 + fsck_handle_ref(ref.buf, NULL, &head_oid, 0, NULL); 580 strbuf_release(&ref); 581 582 if (include_reflogs)
+1
builtin/gc.c
··· 836 }; 837 838 static int dfs_on_ref(const char *refname UNUSED, 839 const struct object_id *oid, 840 int flags UNUSED, 841 void *cb_data)
··· 836 }; 837 838 static int dfs_on_ref(const char *refname UNUSED, 839 + const char *referent UNUSED, 840 const struct object_id *oid, 841 int flags UNUSED, 842 void *cb_data)
+1 -1
builtin/name-rev.c
··· 337 return a->taggerdate != b->taggerdate; 338 } 339 340 - static int name_ref(const char *path, const struct object_id *oid, 341 int flags UNUSED, void *cb_data) 342 { 343 struct object *o = parse_object(the_repository, oid);
··· 337 return a->taggerdate != b->taggerdate; 338 } 339 340 + static int name_ref(const char *path, const char *referent UNUSED, const struct object_id *oid, 341 int flags UNUSED, void *cb_data) 342 { 343 struct object *o = parse_object(the_repository, oid);
+3 -2
builtin/pack-objects.c
··· 771 return WRITE_ONE_WRITTEN; 772 } 773 774 - static int mark_tagged(const char *path UNUSED, const struct object_id *oid, 775 int flag UNUSED, void *cb_data UNUSED) 776 { 777 struct object_id peeled; ··· 3129 } 3130 } 3131 3132 - static int add_ref_tag(const char *tag UNUSED, const struct object_id *oid, 3133 int flag UNUSED, void *cb_data UNUSED) 3134 { 3135 struct object_id peeled; ··· 4076 } 4077 4078 static int mark_bitmap_preferred_tip(const char *refname, 4079 const struct object_id *oid, 4080 int flags UNUSED, 4081 void *data UNUSED)
··· 771 return WRITE_ONE_WRITTEN; 772 } 773 774 + static int mark_tagged(const char *path UNUSED, const char *referent UNUSED, const struct object_id *oid, 775 int flag UNUSED, void *cb_data UNUSED) 776 { 777 struct object_id peeled; ··· 3129 } 3130 } 3131 3132 + static int add_ref_tag(const char *tag UNUSED, const char *referent UNUSED, const struct object_id *oid, 3133 int flag UNUSED, void *cb_data UNUSED) 3134 { 3135 struct object_id peeled; ··· 4076 } 4077 4078 static int mark_bitmap_preferred_tip(const char *refname, 4079 + const char *referent UNUSED, 4080 const struct object_id *oid, 4081 int flags UNUSED, 4082 void *data UNUSED)
+1 -1
builtin/receive-pack.c
··· 300 } 301 } 302 303 - static int show_ref_cb(const char *path_full, const struct object_id *oid, 304 int flag UNUSED, void *data) 305 { 306 struct oidset *seen = data;
··· 300 } 301 } 302 303 + static int show_ref_cb(const char *path_full, const char *referent UNUSED, const struct object_id *oid, 304 int flag UNUSED, void *data) 305 { 306 struct oidset *seen = data;
+3 -1
builtin/remote.c
··· 543 }; 544 545 static int add_branch_for_removal(const char *refname, 546 const struct object_id *oid UNUSED, 547 int flags UNUSED, void *cb_data) 548 { ··· 585 uint32_t symrefs_nr; 586 }; 587 588 - static int read_remote_branches(const char *refname, 589 const struct object_id *oid UNUSED, 590 int flags UNUSED, void *cb_data) 591 { ··· 971 } 972 973 static int append_ref_to_tracked_list(const char *refname, 974 const struct object_id *oid UNUSED, 975 int flags, void *cb_data) 976 {
··· 543 }; 544 545 static int add_branch_for_removal(const char *refname, 546 + const char *referent UNUSED, 547 const struct object_id *oid UNUSED, 548 int flags UNUSED, void *cb_data) 549 { ··· 586 uint32_t symrefs_nr; 587 }; 588 589 + static int read_remote_branches(const char *refname, const char *referent UNUSED, 590 const struct object_id *oid UNUSED, 591 int flags UNUSED, void *cb_data) 592 { ··· 972 } 973 974 static int append_ref_to_tracked_list(const char *refname, 975 + const char *referent UNUSED, 976 const struct object_id *oid UNUSED, 977 int flags, void *cb_data) 978 {
+1
builtin/repack.c
··· 667 }; 668 669 static int midx_snapshot_ref_one(const char *refname UNUSED, 670 const struct object_id *oid, 671 int flag UNUSED, void *_data) 672 {
··· 667 }; 668 669 static int midx_snapshot_ref_one(const char *refname UNUSED, 670 + const char *referent UNUSED, 671 const struct object_id *oid, 672 int flag UNUSED, void *_data) 673 {
+1
builtin/replace.c
··· 49 }; 50 51 static int show_reference(const char *refname, 52 const struct object_id *oid, 53 int flag UNUSED, void *cb_data) 54 {
··· 49 }; 50 51 static int show_reference(const char *refname, 52 + const char *referent UNUSED, 53 const struct object_id *oid, 54 int flag UNUSED, void *cb_data) 55 {
+2 -2
builtin/rev-parse.c
··· 211 return 0; 212 } 213 214 - static int show_reference(const char *refname, const struct object_id *oid, 215 int flag UNUSED, void *cb_data UNUSED) 216 { 217 if (ref_excluded(&ref_excludes, refname)) ··· 220 return 0; 221 } 222 223 - static int anti_reference(const char *refname, const struct object_id *oid, 224 int flag UNUSED, void *cb_data UNUSED) 225 { 226 show_rev(REVERSED, oid, refname);
··· 211 return 0; 212 } 213 214 + static int show_reference(const char *refname, const char *referent UNUSED, const struct object_id *oid, 215 int flag UNUSED, void *cb_data UNUSED) 216 { 217 if (ref_excluded(&ref_excludes, refname)) ··· 220 return 0; 221 } 222 223 + static int anti_reference(const char *refname, const char *referent UNUSED, const struct object_id *oid, 224 int flag UNUSED, void *cb_data UNUSED) 225 { 226 show_rev(REVERSED, oid, refname);
+4 -4
builtin/show-branch.c
··· 410 return 0; 411 } 412 413 - static int append_head_ref(const char *refname, const struct object_id *oid, 414 int flag UNUSED, void *cb_data UNUSED) 415 { 416 struct object_id tmp; ··· 425 return append_ref(refname + ofs, oid, 0); 426 } 427 428 - static int append_remote_ref(const char *refname, const struct object_id *oid, 429 int flag UNUSED, void *cb_data UNUSED) 430 { 431 struct object_id tmp; ··· 451 static const char *match_ref_pattern = NULL; 452 static int match_ref_slash = 0; 453 454 - static int append_matching_ref(const char *refname, const struct object_id *oid, 455 int flag, void *cb_data) 456 { 457 /* we want to allow pattern hold/<asterisk> to show all ··· 468 if (wildmatch(match_ref_pattern, tail, 0)) 469 return 0; 470 if (starts_with(refname, "refs/heads/")) 471 - return append_head_ref(refname, oid, flag, cb_data); 472 if (starts_with(refname, "refs/tags/")) 473 return append_tag_ref(refname, oid, flag, cb_data); 474 return append_ref(refname, oid, 0);
··· 410 return 0; 411 } 412 413 + static int append_head_ref(const char *refname, const char *referent UNUSED, const struct object_id *oid, 414 int flag UNUSED, void *cb_data UNUSED) 415 { 416 struct object_id tmp; ··· 425 return append_ref(refname + ofs, oid, 0); 426 } 427 428 + static int append_remote_ref(const char *refname, const char *referent UNUSED, const struct object_id *oid, 429 int flag UNUSED, void *cb_data UNUSED) 430 { 431 struct object_id tmp; ··· 451 static const char *match_ref_pattern = NULL; 452 static int match_ref_slash = 0; 453 454 + static int append_matching_ref(const char *refname, const char *referent UNUSED, const struct object_id *oid, 455 int flag, void *cb_data) 456 { 457 /* we want to allow pattern hold/<asterisk> to show all ··· 468 if (wildmatch(match_ref_pattern, tail, 0)) 469 return 0; 470 if (starts_with(refname, "refs/heads/")) 471 + return append_head_ref(refname, NULL, oid, flag, cb_data); 472 if (starts_with(refname, "refs/tags/")) 473 return append_tag_ref(refname, oid, flag, cb_data); 474 return append_ref(refname, oid, 0);
+2 -1
builtin/show-ref.c
··· 63 int show_head; 64 }; 65 66 - static int show_ref(const char *refname, const struct object_id *oid, 67 int flag UNUSED, void *cbdata) 68 { 69 struct show_ref_data *data = cbdata; ··· 97 } 98 99 static int add_existing(const char *refname, 100 const struct object_id *oid UNUSED, 101 int flag UNUSED, void *cbdata) 102 {
··· 63 int show_head; 64 }; 65 66 + static int show_ref(const char *refname, const char *referent UNUSED, const struct object_id *oid, 67 int flag UNUSED, void *cbdata) 68 { 69 struct show_ref_data *data = cbdata; ··· 97 } 98 99 static int add_existing(const char *refname, 100 + const char *referent UNUSED, 101 const struct object_id *oid UNUSED, 102 int flag UNUSED, void *cbdata) 103 {
+1
builtin/submodule--helper.c
··· 608 } 609 610 static int handle_submodule_head_ref(const char *refname UNUSED, 611 const struct object_id *oid, 612 int flags UNUSED, 613 void *cb_data)
··· 608 } 609 610 static int handle_submodule_head_ref(const char *refname UNUSED, 611 + const char *referent UNUSED, 612 const struct object_id *oid, 613 int flags UNUSED, 614 void *cb_data)
+1
builtin/worktree.c
··· 626 * Returns 0 on failure and non-zero on success. 627 */ 628 static int first_valid_ref(const char *refname UNUSED, 629 const struct object_id *oid UNUSED, 630 int flags UNUSED, 631 void *cb_data UNUSED)
··· 626 * Returns 0 on failure and non-zero on success. 627 */ 628 static int first_valid_ref(const char *refname UNUSED, 629 + const char *referent UNUSED, 630 const struct object_id *oid UNUSED, 631 int flags UNUSED, 632 void *cb_data UNUSED)
+1
commit-graph.c
··· 1847 }; 1848 1849 static int add_ref_to_set(const char *refname UNUSED, 1850 const struct object_id *oid, 1851 int flags UNUSED, void *cb_data) 1852 {
··· 1847 }; 1848 1849 static int add_ref_to_set(const char *refname UNUSED, 1850 + const char *referent UNUSED, 1851 const struct object_id *oid, 1852 int flags UNUSED, void *cb_data) 1853 {
+1 -1
delta-islands.c
··· 390 rl->hash += sha_core; 391 } 392 393 - static int find_island_for_ref(const char *refname, const struct object_id *oid, 394 int flags UNUSED, void *cb) 395 { 396 struct island_load_data *ild = cb;
··· 390 rl->hash += sha_core; 391 } 392 393 + static int find_island_for_ref(const char *refname, const char *referent UNUSED, const struct object_id *oid, 394 int flags UNUSED, void *cb) 395 { 396 struct island_load_data *ild = cb;
+2
fetch-pack.c
··· 183 } 184 185 static int rev_list_insert_ref_oid(const char *refname UNUSED, 186 const struct object_id *oid, 187 int flag UNUSED, 188 void *cb_data) ··· 610 } 611 612 static int mark_complete_oid(const char *refname UNUSED, 613 const struct object_id *oid, 614 int flag UNUSED, 615 void *cb_data UNUSED)
··· 183 } 184 185 static int rev_list_insert_ref_oid(const char *refname UNUSED, 186 + const char *referent UNUSED, 187 const struct object_id *oid, 188 int flag UNUSED, 189 void *cb_data) ··· 611 } 612 613 static int mark_complete_oid(const char *refname UNUSED, 614 + const char *referent UNUSED, 615 const struct object_id *oid, 616 int flag UNUSED, 617 void *cb_data UNUSED)
+1 -1
help.c
··· 804 struct string_list *similar_refs; 805 }; 806 807 - static int append_similar_ref(const char *refname, 808 const struct object_id *oid UNUSED, 809 int flags UNUSED, void *cb_data) 810 {
··· 804 struct string_list *similar_refs; 805 }; 806 807 + static int append_similar_ref(const char *refname, const char *referent UNUSED, 808 const struct object_id *oid UNUSED, 809 int flags UNUSED, void *cb_data) 810 {
+2 -2
http-backend.c
··· 512 exit(1); 513 } 514 515 - static int show_text_ref(const char *name, const struct object_id *oid, 516 int flag UNUSED, void *cb_data) 517 { 518 const char *name_nons = strip_namespace(name); ··· 568 strbuf_release(&buf); 569 } 570 571 - static int show_head_ref(const char *refname, const struct object_id *oid, 572 int flag, void *cb_data) 573 { 574 struct strbuf *buf = cb_data;
··· 512 exit(1); 513 } 514 515 + static int show_text_ref(const char *name, const char *referent UNUSED, const struct object_id *oid, 516 int flag UNUSED, void *cb_data) 517 { 518 const char *name_nons = strip_namespace(name); ··· 568 strbuf_release(&buf); 569 } 570 571 + static int show_head_ref(const char *refname, const char *referent UNUSED, const struct object_id *oid, 572 int flag, void *cb_data) 573 { 574 struct strbuf *buf = cb_data;
+1 -1
log-tree.c
··· 145 return 1; 146 } 147 148 - static int add_ref_decoration(const char *refname, const struct object_id *oid, 149 int flags UNUSED, 150 void *cb_data) 151 {
··· 145 return 1; 146 } 147 148 + static int add_ref_decoration(const char *refname, const char *referent UNUSED, const struct object_id *oid, 149 int flags UNUSED, 150 void *cb_data) 151 {
+2 -2
ls-refs.c
··· 77 unsigned unborn : 1; 78 }; 79 80 - static int send_ref(const char *refname, const struct object_id *oid, 81 int flag, void *cb_data) 82 { 83 struct ls_refs_data *data = cb_data; ··· 135 oid_is_null = is_null_oid(&oid); 136 if (!oid_is_null || 137 (data->unborn && data->symrefs && (flag & REF_ISSYMREF))) 138 - send_ref(namespaced.buf, oid_is_null ? NULL : &oid, flag, data); 139 strbuf_release(&namespaced); 140 } 141
··· 77 unsigned unborn : 1; 78 }; 79 80 + static int send_ref(const char *refname, const char *referent UNUSED, const struct object_id *oid, 81 int flag, void *cb_data) 82 { 83 struct ls_refs_data *data = cb_data; ··· 135 oid_is_null = is_null_oid(&oid); 136 if (!oid_is_null || 137 (data->unborn && data->symrefs && (flag & REF_ISSYMREF))) 138 + send_ref(namespaced.buf, NULL, oid_is_null ? NULL : &oid, flag, data); 139 strbuf_release(&namespaced); 140 } 141
+1 -1
midx-write.c
··· 655 trace2_region_leave("midx", "prepare_midx_packing_data", the_repository); 656 } 657 658 - static int add_ref_to_pending(const char *refname, 659 const struct object_id *oid, 660 int flag, void *cb_data) 661 {
··· 655 trace2_region_leave("midx", "prepare_midx_packing_data", the_repository); 656 } 657 658 + static int add_ref_to_pending(const char *refname, const char *referent UNUSED, 659 const struct object_id *oid, 660 int flag, void *cb_data) 661 {
+1 -1
negotiator/default.c
··· 38 } 39 } 40 41 - static int clear_marks(const char *refname, const struct object_id *oid, 42 int flag UNUSED, 43 void *cb_data UNUSED) 44 {
··· 38 } 39 } 40 41 + static int clear_marks(const char *refname, const char *referent UNUSED, const struct object_id *oid, 42 int flag UNUSED, 43 void *cb_data UNUSED) 44 {
+1 -1
negotiator/skipping.c
··· 75 return entry; 76 } 77 78 - static int clear_marks(const char *refname, const struct object_id *oid, 79 int flag UNUSED, 80 void *cb_data UNUSED) 81 {
··· 75 return entry; 76 } 77 78 + static int clear_marks(const char *refname, const char *referent UNUSED, const struct object_id *oid, 79 int flag UNUSED, 80 void *cb_data UNUSED) 81 {
+1 -1
notes.c
··· 932 return ret; 933 } 934 935 - static int string_list_add_one_ref(const char *refname, 936 const struct object_id *oid UNUSED, 937 int flag UNUSED, void *cb) 938 {
··· 932 return ret; 933 } 934 935 + static int string_list_add_one_ref(const char *refname, const char *referent UNUSED, 936 const struct object_id *oid UNUSED, 937 int flag UNUSED, void *cb) 938 {
+1 -1
object-name.c
··· 1365 struct commit_list **list; 1366 }; 1367 1368 - static int handle_one_ref(const char *path, const struct object_id *oid, 1369 int flag UNUSED, 1370 void *cb_data) 1371 {
··· 1365 struct commit_list **list; 1366 }; 1367 1368 + static int handle_one_ref(const char *path, const char *referent UNUSED, const struct object_id *oid, 1369 int flag UNUSED, 1370 void *cb_data) 1371 {
+1
pseudo-merge.c
··· 201 } 202 203 static int find_pseudo_merge_group_for_ref(const char *refname, 204 const struct object_id *oid, 205 int flags UNUSED, 206 void *_data)
··· 201 } 202 203 static int find_pseudo_merge_group_for_ref(const char *refname, 204 + const char *referent UNUSED, 205 const struct object_id *oid, 206 int flags UNUSED, 207 void *_data)
+1 -1
reachable.c
··· 79 free_worktrees(worktrees); 80 } 81 82 - static int add_one_ref(const char *path, const struct object_id *oid, 83 int flag, void *cb_data) 84 { 85 struct rev_info *revs = (struct rev_info *)cb_data;
··· 79 free_worktrees(worktrees); 80 } 81 82 + static int add_one_ref(const char *path, const char *referent UNUSED, const struct object_id *oid, 83 int flag, void *cb_data) 84 { 85 struct rev_info *revs = (struct rev_info *)cb_data;
+2 -2
ref-filter.c
··· 2865 * A call-back given to for_each_ref(). Filter refs and keep them for 2866 * later object processing. 2867 */ 2868 - static int filter_one(const char *refname, const struct object_id *oid, int flag, void *cb_data) 2869 { 2870 struct ref_filter_cbdata *ref_cbdata = cb_data; 2871 struct ref_array_item *ref; ··· 2900 } internal; 2901 }; 2902 2903 - static int filter_and_format_one(const char *refname, const struct object_id *oid, int flag, void *cb_data) 2904 { 2905 struct ref_filter_and_format_cbdata *ref_cbdata = cb_data; 2906 struct ref_array_item *ref;
··· 2865 * A call-back given to for_each_ref(). Filter refs and keep them for 2866 * later object processing. 2867 */ 2868 + static int filter_one(const char *refname, const char *referent UNUSED, const struct object_id *oid, int flag, void *cb_data) 2869 { 2870 struct ref_filter_cbdata *ref_cbdata = cb_data; 2871 struct ref_array_item *ref; ··· 2900 } internal; 2901 }; 2902 2903 + static int filter_and_format_one(const char *refname, const char *referent UNUSED, const struct object_id *oid, int flag, void *cb_data) 2904 { 2905 struct ref_filter_and_format_cbdata *ref_cbdata = cb_data; 2906 struct ref_array_item *ref;
+1
reflog.c
··· 300 } 301 302 static int push_tip_to_list(const char *refname UNUSED, 303 const struct object_id *oid, 304 int flags, void *cb_data) 305 {
··· 300 } 301 302 static int push_tip_to_list(const char *refname UNUSED, 303 + const char *referent UNUSED, 304 const struct object_id *oid, 305 int flags, void *cb_data) 306 {
+7 -7
refs.c
··· 414 NULL, NULL); 415 } 416 417 - static int for_each_filter_refs(const char *refname, 418 const struct object_id *oid, 419 int flags, void *data) 420 { ··· 424 return 0; 425 if (filter->prefix) 426 skip_prefix(refname, filter->prefix, &refname); 427 - return filter->fn(refname, oid, flags, filter->cb_data); 428 } 429 430 struct warn_if_dangling_data { ··· 435 const char *msg_fmt; 436 }; 437 438 - static int warn_if_dangling_symref(const char *refname, 439 const struct object_id *oid UNUSED, 440 int flags, void *cb_data) 441 { ··· 506 507 strbuf_addf(&buf, "%sHEAD", get_git_namespace()); 508 if (!refs_read_ref_full(refs, buf.buf, RESOLVE_REF_READING, &oid, &flag)) 509 - ret = fn(buf.buf, &oid, flag, cb_data); 510 strbuf_release(&buf); 511 512 return ret; ··· 1547 1548 if (refs_resolve_ref_unsafe(refs, "HEAD", RESOLVE_REF_READING, 1549 &oid, &flag)) 1550 - return fn("HEAD", &oid, flag, cb_data); 1551 1552 return 0; 1553 } ··· 2387 void *cb_data; 2388 }; 2389 2390 - static int do_for_each_reflog_helper(const char *refname, 2391 const struct object_id *oid UNUSED, 2392 int flags, 2393 void *cb_data) ··· 2593 struct strbuf *errbuf; 2594 }; 2595 2596 - static int migrate_one_ref(const char *refname, const struct object_id *oid, 2597 int flags, void *cb_data) 2598 { 2599 struct migration_data *data = cb_data;
··· 414 NULL, NULL); 415 } 416 417 + static int for_each_filter_refs(const char *refname, const char *referent, 418 const struct object_id *oid, 419 int flags, void *data) 420 { ··· 424 return 0; 425 if (filter->prefix) 426 skip_prefix(refname, filter->prefix, &refname); 427 + return filter->fn(refname, referent, oid, flags, filter->cb_data); 428 } 429 430 struct warn_if_dangling_data { ··· 435 const char *msg_fmt; 436 }; 437 438 + static int warn_if_dangling_symref(const char *refname, const char *referent UNUSED, 439 const struct object_id *oid UNUSED, 440 int flags, void *cb_data) 441 { ··· 506 507 strbuf_addf(&buf, "%sHEAD", get_git_namespace()); 508 if (!refs_read_ref_full(refs, buf.buf, RESOLVE_REF_READING, &oid, &flag)) 509 + ret = fn(buf.buf, NULL, &oid, flag, cb_data); 510 strbuf_release(&buf); 511 512 return ret; ··· 1547 1548 if (refs_resolve_ref_unsafe(refs, "HEAD", RESOLVE_REF_READING, 1549 &oid, &flag)) 1550 + return fn("HEAD", NULL, &oid, flag, cb_data); 1551 1552 return 0; 1553 } ··· 2387 void *cb_data; 2388 }; 2389 2390 + static int do_for_each_reflog_helper(const char *refname, const char *referent, 2391 const struct object_id *oid UNUSED, 2392 int flags, 2393 void *cb_data) ··· 2593 struct strbuf *errbuf; 2594 }; 2595 2596 + static int migrate_one_ref(const char *refname, const char *referent UNUSED, const struct object_id *oid, 2597 int flags, void *cb_data) 2598 { 2599 struct migration_data *data = cb_data;
+1 -1
refs.h
··· 298 * arguments is only guaranteed to be valid for the duration of a 299 * single callback invocation. 300 */ 301 - typedef int each_ref_fn(const char *refname, 302 const struct object_id *oid, int flags, void *cb_data); 303 304 /*
··· 298 * arguments is only guaranteed to be valid for the duration of a 299 * single callback invocation. 300 */ 301 + typedef int each_ref_fn(const char *refname, const char *referent, 302 const struct object_id *oid, int flags, void *cb_data); 303 304 /*
+1 -1
refs/files-backend.c
··· 3044 return 0; 3045 } 3046 3047 - static int ref_present(const char *refname, 3048 const struct object_id *oid UNUSED, 3049 int flags UNUSED, 3050 void *cb_data)
··· 3044 return 0; 3045 } 3046 3047 + static int ref_present(const char *refname, const char *referent UNUSED, 3048 const struct object_id *oid UNUSED, 3049 int flags UNUSED, 3050 void *cb_data)
+1 -1
refs/iterator.c
··· 450 451 current_ref_iter = iter; 452 while ((ok = ref_iterator_advance(iter)) == ITER_OK) { 453 - retval = fn(iter->refname, iter->oid, iter->flags, cb_data); 454 if (retval) { 455 /* 456 * If ref_iterator_abort() returns ITER_ERROR,
··· 450 451 current_ref_iter = iter; 452 while ((ok = ref_iterator_advance(iter)) == ITER_OK) { 453 + retval = fn(iter->refname, iter->referent, iter->oid, iter->flags, cb_data); 454 if (retval) { 455 /* 456 * If ref_iterator_abort() returns ITER_ERROR,
+2 -2
remote.c
··· 2354 return 1; 2355 } 2356 2357 - static int one_local_ref(const char *refname, const struct object_id *oid, 2358 int flag UNUSED, 2359 void *cb_data) 2360 { ··· 2439 struct refspec *rs; 2440 }; 2441 2442 - static int get_stale_heads_cb(const char *refname, const struct object_id *oid, 2443 int flags, void *cb_data) 2444 { 2445 struct stale_heads_info *info = cb_data;
··· 2354 return 1; 2355 } 2356 2357 + static int one_local_ref(const char *refname, const char *referent UNUSED, const struct object_id *oid, 2358 int flag UNUSED, 2359 void *cb_data) 2360 { ··· 2439 struct refspec *rs; 2440 }; 2441 2442 + static int get_stale_heads_cb(const char *refname, const char *referent UNUSED, const struct object_id *oid, 2443 int flags, void *cb_data) 2444 { 2445 struct stale_heads_info *info = cb_data;
+1
replace-object.c
··· 9 #include "commit.h" 10 11 static int register_replace_ref(const char *refname, 12 const struct object_id *oid, 13 int flag UNUSED, 14 void *cb_data)
··· 9 #include "commit.h" 10 11 static int register_replace_ref(const char *refname, 12 + const char *referent UNUSED, 13 const struct object_id *oid, 14 int flag UNUSED, 15 void *cb_data)
+1 -1
revision.c
··· 1648 struct worktree *wt; 1649 }; 1650 1651 - static int handle_one_ref(const char *path, const struct object_id *oid, 1652 int flag UNUSED, 1653 void *cb_data) 1654 {
··· 1648 struct worktree *wt; 1649 }; 1650 1651 + static int handle_one_ref(const char *path, const char *referent UNUSED, const struct object_id *oid, 1652 int flag UNUSED, 1653 void *cb_data) 1654 {
+1 -1
server-info.c
··· 147 return ret; 148 } 149 150 - static int add_info_ref(const char *path, const struct object_id *oid, 151 int flag UNUSED, 152 void *cb_data) 153 {
··· 147 return ret; 148 } 149 150 + static int add_info_ref(const char *path, const char *referent UNUSED, const struct object_id *oid, 151 int flag UNUSED, 152 void *cb_data) 153 {
+2
shallow.c
··· 612 } 613 614 static int mark_uninteresting(const char *refname UNUSED, 615 const struct object_id *oid, 616 int flags UNUSED, 617 void *cb_data UNUSED) ··· 727 }; 728 729 static int add_ref(const char *refname UNUSED, 730 const struct object_id *oid, 731 int flags UNUSED, 732 void *cb_data)
··· 612 } 613 614 static int mark_uninteresting(const char *refname UNUSED, 615 + const char *referent UNUSED, 616 const struct object_id *oid, 617 int flags UNUSED, 618 void *cb_data UNUSED) ··· 728 }; 729 730 static int add_ref(const char *refname UNUSED, 731 + const char *referent UNUSED, 732 const struct object_id *oid, 733 int flags UNUSED, 734 void *cb_data)
+2
submodule.c
··· 953 } 954 955 static int has_remote(const char *refname UNUSED, 956 const struct object_id *oid UNUSED, 957 int flags UNUSED, void *cb_data UNUSED) 958 { ··· 1273 } 1274 1275 static int append_oid_to_array(const char *ref UNUSED, 1276 const struct object_id *oid, 1277 int flags UNUSED, void *data) 1278 {
··· 953 } 954 955 static int has_remote(const char *refname UNUSED, 956 + const char *referent UNUSED, 957 const struct object_id *oid UNUSED, 958 int flags UNUSED, void *cb_data UNUSED) 959 { ··· 1274 } 1275 1276 static int append_oid_to_array(const char *ref UNUSED, 1277 + const char *referent UNUSED, 1278 const struct object_id *oid, 1279 int flags UNUSED, void *data) 1280 {
+1 -1
t/helper/test-ref-store.c
··· 156 return refs_rename_ref(refs, oldref, newref, logmsg); 157 } 158 159 - static int each_ref(const char *refname, const struct object_id *oid, 160 int flags, void *cb_data UNUSED) 161 { 162 printf("%s %s 0x%x\n", oid_to_hex(oid), refname, flags);
··· 156 return refs_rename_ref(refs, oldref, newref, logmsg); 157 } 158 159 + static int each_ref(const char *refname, const char *referent UNUSED, const struct object_id *oid, 160 int flags, void *cb_data UNUSED) 161 { 162 printf("%s %s 0x%x\n", oid_to_hex(oid), refname, flags);
+4 -4
upload-pack.c
··· 857 } 858 } 859 860 - static int check_ref(const char *refname_full, const struct object_id *oid, 861 int flag, void *cb_data); 862 static void deepen(struct upload_pack_data *data, int depth) 863 { ··· 1208 return 0; 1209 } 1210 1211 - static int check_ref(const char *refname_full, const struct object_id *oid, 1212 int flag UNUSED, void *cb_data) 1213 { 1214 const char *refname = strip_namespace(refname_full); ··· 1276 return; 1277 } 1278 1279 - static int send_ref(const char *refname, const struct object_id *oid, 1280 int flag UNUSED, void *cb_data) 1281 { 1282 write_v0_ref(cb_data, refname, strip_namespace(refname), oid); 1283 return 0; 1284 } 1285 1286 - static int find_symref(const char *refname, 1287 const struct object_id *oid UNUSED, 1288 int flag, void *cb_data) 1289 {
··· 857 } 858 } 859 860 + static int check_ref(const char *refname_full, const char *referent UNUSED, const struct object_id *oid, 861 int flag, void *cb_data); 862 static void deepen(struct upload_pack_data *data, int depth) 863 { ··· 1208 return 0; 1209 } 1210 1211 + static int check_ref(const char *refname_full, const char *referent UNUSED,const struct object_id *oid, 1212 int flag UNUSED, void *cb_data) 1213 { 1214 const char *refname = strip_namespace(refname_full); ··· 1276 return; 1277 } 1278 1279 + static int send_ref(const char *refname, const char *referent UNUSED, const struct object_id *oid, 1280 int flag UNUSED, void *cb_data) 1281 { 1282 write_v0_ref(cb_data, refname, strip_namespace(refname), oid); 1283 return 0; 1284 } 1285 1286 + static int find_symref(const char *refname, const char *referent UNUSED, 1287 const struct object_id *oid UNUSED, 1288 int flag, void *cb_data) 1289 {
+1
walker.c
··· 221 } 222 223 static int mark_complete(const char *path UNUSED, 224 const struct object_id *oid, 225 int flag UNUSED, 226 void *cb_data UNUSED)
··· 221 } 222 223 static int mark_complete(const char *path UNUSED, 224 + const char *referent UNUSED, 225 const struct object_id *oid, 226 int flag UNUSED, 227 void *cb_data UNUSED)
+1 -1
worktree.c
··· 546 refname.buf, 547 RESOLVE_REF_READING, 548 &oid, &flag)) 549 - ret = fn(refname.buf, &oid, flag, cb_data); 550 if (ret) 551 break; 552 }
··· 546 refname.buf, 547 RESOLVE_REF_READING, 548 &oid, &flag)) 549 + ret = fn(refname.buf, NULL, &oid, flag, cb_data); 550 if (ret) 551 break; 552 }