summaryrefslogtreecommitdiff
path: root/builtin/replace.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2015-08-03 18:01:10 (GMT)
committerJunio C Hamano <gitster@pobox.com>2015-08-03 18:01:10 (GMT)
commit31a0ad545681159be2ccc633a1a16a891cafbae3 (patch)
tree26ab4d6997f50fdab7ecebfa950d926683a5c492 /builtin/replace.c
parenta17c56c056d5fea0843b429132904c429a900229 (diff)
parent58d121b22b5b83a27a1891dcf335458f687cac1e (diff)
downloadgit-31a0ad545681159be2ccc633a1a16a891cafbae3.zip
git-31a0ad545681159be2ccc633a1a16a891cafbae3.tar.gz
git-31a0ad545681159be2ccc633a1a16a891cafbae3.tar.bz2
Merge branch 'mh/replace-refs'
Add an environment variable to tell Git to look into refs hierarchy other than refs/replace/ for the object replacement data. * mh/replace-refs: Allow to control where the replace refs are looked for
Diffstat (limited to 'builtin/replace.c')
-rw-r--r--builtin/replace.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/builtin/replace.c b/builtin/replace.c
index 0d52e7f..6b3c469 100644
--- a/builtin/replace.c
+++ b/builtin/replace.c
@@ -104,9 +104,9 @@ static int for_each_replace_name(const char **argv, each_replace_name_fn fn)
continue;
}
full_hex = sha1_to_hex(sha1);
- snprintf(ref, sizeof(ref), "refs/replace/%s", full_hex);
+ snprintf(ref, sizeof(ref), "%s%s", git_replace_ref_base, full_hex);
/* read_ref() may reuse the buffer */
- full_hex = ref + strlen("refs/replace/");
+ full_hex = ref + strlen(git_replace_ref_base);
if (read_ref(ref, sha1)) {
error("replace ref '%s' not found.", full_hex);
had_error = 1;
@@ -134,7 +134,7 @@ static void check_ref_valid(unsigned char object[20],
int force)
{
if (snprintf(ref, ref_size,
- "refs/replace/%s",
+ "%s%s", git_replace_ref_base,
sha1_to_hex(object)) > ref_size - 1)
die("replace ref name too long: %.*s...", 50, ref);
if (check_refname_format(ref, 0))