diff options
author | Mike Hommey <mh@glandium.org> | 2015-06-11 21:34:59 (GMT) |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2015-06-12 22:28:17 (GMT) |
commit | 58d121b22b5b83a27a1891dcf335458f687cac1e (patch) | |
tree | c5172c1cc9376718074bf2c008655fbd970d0b7d /log-tree.c | |
parent | f86f31ab33c3406adebbb9f9f61be550dcc5a472 (diff) | |
download | git-58d121b22b5b83a27a1891dcf335458f687cac1e.zip git-58d121b22b5b83a27a1891dcf335458f687cac1e.tar.gz git-58d121b22b5b83a27a1891dcf335458f687cac1e.tar.bz2 |
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 'log-tree.c')
-rw-r--r-- | log-tree.c | 5 |
1 files changed, 3 insertions, 2 deletions
@@ -96,11 +96,12 @@ static int add_ref_decoration(const char *refname, const unsigned char *sha1, in assert(cb_data == NULL); - if (starts_with(refname, "refs/replace/")) { + if (starts_with(refname, git_replace_ref_base)) { unsigned char original_sha1[20]; if (!check_replace_refs) return 0; - if (get_sha1_hex(refname + 13, original_sha1)) { + if (get_sha1_hex(refname + strlen(git_replace_ref_base), + original_sha1)) { warning("invalid replace ref %s", refname); return 0; } |