Code

Merge branch 'nd/extended-sha1-relpath' into next
authorJunio C Hamano <gitster@pobox.com>
Wed, 8 Dec 2010 20:25:24 +0000 (12:25 -0800)
committerJunio C Hamano <gitster@pobox.com>
Wed, 8 Dec 2010 20:25:24 +0000 (12:25 -0800)
* nd/extended-sha1-relpath:
  get_sha1: support relative path ":path" syntax
  Make prefix_path() return char* without const

Conflicts:
sha1_name.c

1  2 
cache.h
setup.c
sha1_name.c

diff --cc cache.h
Simple merge
diff --cc setup.c
Simple merge
diff --cc sha1_name.c
index 2c3a5fb363ff9b11a971b45e85819b2c0aaad157,f918faf5c7e635b1a3ad9e9e423cefabfbac4ead..451b3de2fc50e653881d8ff117127f6df4df1ebd
@@@ -1087,9 -1085,9 +1105,10 @@@ int get_sha1_with_context_1(const char 
        if (name[0] == ':') {
                int stage = 0;
                struct cache_entry *ce;
+               char *new_path = NULL;
                int pos;
                if (namelen > 2 && name[1] == '/')
 +                      /* don't need mode for commit */
                        return get_sha1_oneline(name + 2, sha1);
                if (namelen < 3 ||
                    name[2] != ':' ||
                                break;
                        if (ce_stage(ce) == stage) {
                                hashcpy(sha1, ce->sha1);
 +                              oc->mode = ce->ce_mode;
+                               free(new_path);
                                return 0;
                        }
                        pos++;