From: Junio C Hamano Date: Mon, 3 Aug 2015 18:01:10 +0000 (-0700) Subject: Merge branch 'mh/replace-refs' X-Git-Tag: v2.6.0-rc0~117 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=31a0ad545681159be2ccc633a1a16a891cafbae3;p=thirdparty%2Fgit.git 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 --- 31a0ad545681159be2ccc633a1a16a891cafbae3 diff --cc log-tree.c index 01beb11f65,9c25bbc1c5..e2f6de73ef --- a/log-tree.c +++ b/log-tree.c @@@ -97,11 -96,12 +97,12 @@@ static int add_ref_decoration(const cha assert(cb_data == NULL); - if (starts_with(refname, "refs/replace/")) { + if (starts_with(refname, git_replace_ref_base)) { - unsigned char original_sha1[20]; + struct object_id original_oid; if (!check_replace_refs) return 0; - if (get_oid_hex(refname + 13, &original_oid)) { - if (get_sha1_hex(refname + strlen(git_replace_ref_base), - original_sha1)) { ++ if (get_oid_hex(refname + strlen(git_replace_ref_base), ++ &original_oid)) { warning("invalid replace ref %s", refname); return 0; }