Allow to control where the replace refs are looked for
[gitweb.git] / log-tree.c
index 8dba7be92e34e511b1d464983bb6d13861f1555e..9c25bbc1c5c4b90233ac48f4469cdd7cfe3c68ad 100644 (file)
@@ -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;
                }