Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/refs.c
diff options
context:
space:
mode:
authorMike Hommey <mh@glandium.org>2015-06-12 00:34:59 +0300
committerJunio C Hamano <gitster@pobox.com>2015-06-13 01:28:17 +0300
commit58d121b22b5b83a27a1891dcf335458f687cac1e (patch)
treec5172c1cc9376718074bf2c008655fbd970d0b7d /refs.c
parentf86f31ab33c3406adebbb9f9f61be550dcc5a472 (diff)
Allow to control where the replace refs are looked for
It can be useful to have grafts or replace refs for specific use-cases while keeping the default "view" of the repository pristine (or with a different set of grafts/replace refs). It is possible to use a different graft file with GIT_GRAFT_FILE, but while replace refs are more powerful, they don't have an equivalent override. Add a GIT_REPLACE_REF_BASE environment variable to control where git is going to look for replace refs. Signed-off-by: Mike Hommey <mh@glandium.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'refs.c')
-rw-r--r--refs.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/refs.c b/refs.c
index 8480d8dbf5..6fc65d239f 100644
--- a/refs.c
+++ b/refs.c
@@ -2106,7 +2106,8 @@ int for_each_remote_ref_submodule(const char *submodule, each_ref_fn fn, void *c
int for_each_replace_ref(each_ref_fn fn, void *cb_data)
{
- return do_for_each_ref(&ref_cache, "refs/replace/", fn, 13, 0, cb_data);
+ return do_for_each_ref(&ref_cache, git_replace_ref_base, fn,
+ strlen(git_replace_ref_base), 0, cb_data);
}
int head_ref_namespaced(each_ref_fn fn, void *cb_data)