OSDN Git Service

Merge branch 'mh/replace-refs'
authorJunio C Hamano <gitster@pobox.com>
Mon, 3 Aug 2015 18:01:10 +0000 (11:01 -0700)
committerJunio C Hamano <gitster@pobox.com>
Mon, 3 Aug 2015 18:01:10 +0000 (11:01 -0700)
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

1  2 
builtin/replace.c
cache.h
log-tree.c
refs.c

Simple merge
diff --cc cache.h
Simple merge
diff --cc 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;
                }
diff --cc refs.c
Simple merge