From: Christian Couder Date: Fri, 23 Jan 2009 09:06:38 +0000 (+0100) Subject: refs: add a "for_each_replace_ref" function X-Git-Tag: v1.6.5-rc0~52^2~13 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=292687003abcfb68d296c57d7e812b0469f74647;p=git.git 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 Signed-off-by: Junio C Hamano --- diff --git a/refs.c b/refs.c index 24438c652..6a136512c 100644 --- a/refs.c +++ b/refs.c @@ -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, diff --git a/refs.h b/refs.h index c11f6a6d5..777b5b7ca 100644 --- a/refs.h +++ b/refs.h @@ -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 *);