Skip to content

Commit

Permalink
refs: add a "for_each_replace_ref" function
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Christian Couder authored and Junio C Hamano committed Jun 1, 2009
1 parent f9275c6 commit 2926870
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
5 changes: 5 additions & 0 deletions refs.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
1 change: 1 addition & 0 deletions refs.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 *);
Expand Down

0 comments on commit 2926870

Please sign in to comment.