Merge branch 'nd/extended-sha1-relpath'
authorJunio C Hamano <gitster@pobox.com>
Thu, 16 Dec 2010 20:51:05 +0000 (12:51 -0800)
committerJunio C Hamano <gitster@pobox.com>
Thu, 16 Dec 2010 20:51:05 +0000 (12:51 -0800)
* nd/extended-sha1-relpath:
  get_sha1: teach ":$n:<path>" the same relative path logic
  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,207405688bb919363c0fdde31083f2e57d26e050..8f49279642bf1aa8ce74fee351772e3fb28a73c4
@@@ -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++;