From: Junio C Hamano Date: Tue, 21 Dec 2010 22:30:19 +0000 (-0800) Subject: Merge branch 'nd/oneline-sha1-name-from-specific-ref' X-Git-Tag: v1.7.4-rc0~19 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=41cd7974b0b67b78c39bccc86718dbe19390f768;p=git.git Merge branch 'nd/oneline-sha1-name-from-specific-ref' * 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 --- 41cd7974b0b67b78c39bccc86718dbe19390f768 diff --cc sha1_name.c index 8f4927964,c5c59ced7..ceb9cdd86 --- a/sha1_name.c +++ b/sha1_name.c @@@ -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])