Code

Merge branch 'nd/oneline-sha1-name-from-specific-ref'
authorJunio C Hamano <gitster@pobox.com>
Tue, 21 Dec 2010 22:30:19 +0000 (14:30 -0800)
committerJunio C Hamano <gitster@pobox.com>
Tue, 21 Dec 2010 22:30:19 +0000 (14:30 -0800)
* nd/oneline-sha1-name-from-specific-ref:
  get_sha1: handle special case $commit^{/}
  get_sha1: support $commit^{/regex} syntax
  get_sha1_oneline: make callers prepare the commit list to traverse
  get_sha1_oneline: fix lifespan rule of temp_commit_buffer variable

1  2 
Documentation/revisions.txt
sha1_name.c

Simple merge
diff --cc sha1_name.c
index 8f49279642bf1aa8ce74fee351772e3fb28a73c4,c5c59ced7f0cbd9ced026d44df6439da65082fb8..ceb9cdd860da78bf3fe0a1819846ded0e87fda8c
@@@ -1105,11 -1112,12 +1130,13 @@@ 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 > 2 && name[1] == '/') {
+                       struct commit_list *list = NULL;
+                       for_each_ref(handle_one_ref, &list);
+                       return get_sha1_oneline(name + 2, sha1, list);
+               }
                if (namelen < 3 ||
                    name[2] != ':' ||
                    name[1] < '0' || '3' < name[1])