Skip to content

Commit 0d296c5

Browse files
stefanbellergitster
authored andcommitted
refs: allow for_each_replace_ref to handle arbitrary repositories
Signed-off-by: Stefan Beller <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 64a7416 commit 0d296c5

File tree

2 files changed

+3
-5
lines changed

2 files changed

+3
-5
lines changed

refs.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1415,9 +1415,9 @@ int refs_for_each_fullref_in(struct ref_store *refs, const char *prefix,
14151415
return do_for_each_ref(refs, prefix, fn, 0, flag, cb_data);
14161416
}
14171417

1418-
int for_each_replace_ref_the_repository(each_ref_fn fn, void *cb_data)
1418+
int for_each_replace_ref(struct repository *r, each_ref_fn fn, void *cb_data)
14191419
{
1420-
return do_for_each_ref(get_main_ref_store(the_repository),
1420+
return do_for_each_ref(get_main_ref_store(r),
14211421
git_replace_ref_base, fn,
14221422
strlen(git_replace_ref_base),
14231423
DO_FOR_EACH_INCLUDE_BROKEN, cb_data);

refs.h

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -300,9 +300,7 @@ int for_each_fullref_in(const char *prefix, each_ref_fn fn, void *cb_data,
300300
int for_each_tag_ref(each_ref_fn fn, void *cb_data);
301301
int for_each_branch_ref(each_ref_fn fn, void *cb_data);
302302
int for_each_remote_ref(each_ref_fn fn, void *cb_data);
303-
#define for_each_replace_ref(r, fn, cb) \
304-
for_each_replace_ref_##r(fn, cb)
305-
int for_each_replace_ref_the_repository(each_ref_fn fn, void *cb_data);
303+
int for_each_replace_ref(struct repository *r, each_ref_fn fn, void *cb_data);
306304
int for_each_glob_ref(each_ref_fn fn, const char *pattern, void *cb_data);
307305
int for_each_glob_ref_in(each_ref_fn fn, const char *pattern,
308306
const char *prefix, void *cb_data);

0 commit comments

Comments
 (0)