diff options
author | Patrick Steinhardt <ps@pks.im> | 2024-05-07 09:11:53 +0200 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2024-05-07 19:06:59 +0200 |
commit | 2e5c4758b75f7cbae612c89b177aa045fa4f9c68 (patch) | |
tree | 4836d2b3c740848d105355f0c6150f32acdcd0de /reflog.c | |
parent | cocci: introduce rules to transform "refs" to pass ref store (diff) | |
download | git-2e5c4758b75f7cbae612c89b177aa045fa4f9c68.tar.xz git-2e5c4758b75f7cbae612c89b177aa045fa4f9c68.zip |
cocci: apply rules to rewrite callers of "refs" interfaces
Apply the rules that rewrite callers of "refs" interfaces to explicitly
pass `struct ref_store`. The resulting patch has been applied with the
`--whitespace=fix` option.
Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'reflog.c')
-rw-r--r-- | reflog.c | 20 |
1 files changed, 12 insertions, 8 deletions
@@ -343,7 +343,8 @@ void reflog_expiry_prepare(const char *refname, case UE_ALWAYS: return; case UE_HEAD: - for_each_ref(push_tip_to_list, &cb->tips); + refs_for_each_ref(get_main_ref_store(the_repository), + push_tip_to_list, &cb->tips); for (elem = cb->tips; elem; elem = elem->next) commit_list_insert(elem->item, &cb->mark_list); break; @@ -416,19 +417,22 @@ int reflog_delete(const char *rev, enum expire_reflog_flags flags, int verbose) recno = strtoul(spec + 2, &ep, 10); if (*ep == '}') { cmd.recno = -recno; - for_each_reflog_ent(ref, count_reflog_ent, &cmd); + refs_for_each_reflog_ent(get_main_ref_store(the_repository), + ref, count_reflog_ent, &cmd); } else { cmd.expire_total = approxidate(spec + 2); - for_each_reflog_ent(ref, count_reflog_ent, &cmd); + refs_for_each_reflog_ent(get_main_ref_store(the_repository), + ref, count_reflog_ent, &cmd); cmd.expire_total = 0; } cb.cmd = cmd; - status |= reflog_expire(ref, flags, - reflog_expiry_prepare, - should_prune_fn, - reflog_expiry_cleanup, - &cb); + status |= refs_reflog_expire(get_main_ref_store(the_repository), ref, + flags, + reflog_expiry_prepare, + should_prune_fn, + reflog_expiry_cleanup, + &cb); cleanup: free(ref); |