From: Junio C Hamano Date: Tue, 21 Dec 2010 01:45:08 +0000 (-0800) Subject: Merge branch 'nd/oneline-sha1-name-from-specific-ref' into next X-Git-Tag: ko-next~52 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=553cf37c23f6583a8973ab5f6351b2724917228b;p=git.git Merge branch 'nd/oneline-sha1-name-from-specific-ref' into next * 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 --- 553cf37c23f6583a8973ab5f6351b2724917228b 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])