Skip to content

Commit 2926870

Browse files
chriscoolgitster
authored andcommitted
refs: add a "for_each_replace_ref" function
This is some preparation work for the following patches that are using the "refs/replace/" ref namespace. Signed-off-by: Christian Couder <chriscool@tuxfamily.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
1 parent f9275c6 commit 2926870

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

refs.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -667,6 +667,11 @@ int for_each_remote_ref(each_ref_fn fn, void *cb_data)
667667
return for_each_ref_in("refs/remotes/", fn, cb_data);
668668
}
669669

670+
int for_each_replace_ref(each_ref_fn fn, void *cb_data)
671+
{
672+
return do_for_each_ref("refs/replace/", fn, 13, 0, cb_data);
673+
}
674+
670675
int for_each_rawref(each_ref_fn fn, void *cb_data)
671676
{
672677
return do_for_each_ref("refs/", fn, 0,

refs.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ extern int for_each_ref_in(const char *, each_ref_fn, void *);
2424
extern int for_each_tag_ref(each_ref_fn, void *);
2525
extern int for_each_branch_ref(each_ref_fn, void *);
2626
extern int for_each_remote_ref(each_ref_fn, void *);
27+
extern int for_each_replace_ref(each_ref_fn, void *);
2728

2829
/* can be used to learn about broken ref and symref */
2930
extern int for_each_rawref(each_ref_fn, void *);

0 commit comments

Comments
 (0)