[PATCH v9 02/10] Iterate over the "refs/" namespace in for_each_[raw]ref
- From
Han-Wen Nienhuys via GitGitGadget <gitgitgadget@gmail.com>
- Date
- Apr 20, 2020, 21:14 UTC
- Message-ID
- <89b68145e8f5cb7127a028ebad50d144790fc16b.1587417295.git.gitgitgadget@gmail.com>
- In-Reply-To
- <pull.539.v9.git.1587417295.gitgitgadget@gmail.com>
From: Han-Wen Nienhuys <hanwen@google.com>
This happens implicitly in the files/packed ref backend; making it explicit simplifies adding alternate ref storage backends, such as reftable.
Signed-off-by: Han-Wen Nienhuys <hanwen@google.com> --- refs.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/refs.c b/refs.c index 1ab0bb54d3d..3b9742d03cb 100644 --- a/refs.c +++ b/refs.c @@ -1569,7 +1569,7 @@ static int do_for_each_ref(struct ref_store *refs, const char *prefix, int refs_for_each_ref(struct ref_store *refs, each_ref_fn fn, void *cb_data) { - return do_for_each_ref(refs, "", fn, 0, 0, cb_data); + return do_for_each_ref(refs, "refs/", fn, 0, 0, cb_data); } int for_each_ref(each_ref_fn fn, void *cb_data) @@ -1629,8 +1629,8 @@ int for_each_namespaced_ref(each_ref_fn fn, void *cb_data) int refs_for_each_rawref(struct ref_store *refs, each_ref_fn fn, void *cb_data) { - return do_for_each_ref(refs, "", fn, 0, - DO_FOR_EACH_INCLUDE_BROKEN, cb_data); + return do_for_each_ref(refs, "refs/", fn, 0, DO_FOR_EACH_INCLUDE_BROKEN, + cb_data); } int for_each_rawref(each_ref_fn fn, void *cb_data)
-- gitgitgadget