Commit 0d296c57 authored by Stefan Beller's avatar Stefan Beller Committed by Junio C Hamano

refs: allow for_each_replace_ref to handle arbitrary repositories

Signed-off-by: Stefan Beller's avatarStefan Beller <sbeller@google.com>
Signed-off-by: default avatarJunio C Hamano <gitster@pobox.com>
parent 64a74161
......@@ -1415,9 +1415,9 @@ int refs_for_each_fullref_in(struct ref_store *refs, const char *prefix,
return do_for_each_ref(refs, prefix, fn, 0, flag, cb_data);
}
int for_each_replace_ref_the_repository(each_ref_fn fn, void *cb_data)
int for_each_replace_ref(struct repository *r, each_ref_fn fn, void *cb_data)
{
return do_for_each_ref(get_main_ref_store(the_repository),
return do_for_each_ref(get_main_ref_store(r),
git_replace_ref_base, fn,
strlen(git_replace_ref_base),
DO_FOR_EACH_INCLUDE_BROKEN, cb_data);
......
......@@ -300,9 +300,7 @@ int for_each_fullref_in(const char *prefix, each_ref_fn fn, void *cb_data,
int for_each_tag_ref(each_ref_fn fn, void *cb_data);
int for_each_branch_ref(each_ref_fn fn, void *cb_data);
int for_each_remote_ref(each_ref_fn fn, void *cb_data);
#define for_each_replace_ref(r, fn, cb) \
for_each_replace_ref_##r(fn, cb)
int for_each_replace_ref_the_repository(each_ref_fn fn, void *cb_data);
int for_each_replace_ref(struct repository *r, each_ref_fn fn, void *cb_data);
int for_each_glob_ref(each_ref_fn fn, const char *pattern, void *cb_data);
int for_each_glob_ref_in(each_ref_fn fn, const char *pattern,
const char *prefix, void *cb_data);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment