1
0
Fork 0
mirror of https://github.com/git/git.git synced 2024-05-20 00:36:07 +02:00

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>
This commit is contained in:
Christian Couder 2009-01-23 10:06:38 +01:00 committed by Junio C Hamano
parent f9275c68af
commit 292687003a
2 changed files with 6 additions and 0 deletions

5
refs.c
View File

@ -667,6 +667,11 @@ int for_each_remote_ref(each_ref_fn fn, void *cb_data)
return for_each_ref_in("refs/remotes/", fn, cb_data);
}
int for_each_replace_ref(each_ref_fn fn, void *cb_data)
{
return do_for_each_ref("refs/replace/", fn, 13, 0, cb_data);
}
int for_each_rawref(each_ref_fn fn, void *cb_data)
{
return do_for_each_ref("refs/", fn, 0,

1
refs.h
View File

@ -24,6 +24,7 @@ extern int for_each_ref_in(const char *, each_ref_fn, void *);
extern int for_each_tag_ref(each_ref_fn, void *);
extern int for_each_branch_ref(each_ref_fn, void *);
extern int for_each_remote_ref(each_ref_fn, void *);
extern int for_each_replace_ref(each_ref_fn, void *);
/* can be used to learn about broken ref and symref */
extern int for_each_rawref(each_ref_fn, void *);