aboutsummaryrefslogtreecommitdiff
path: root/revision.h
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2013-05-15 14:32:30 -0700
committerJunio C Hamano <gitster@pobox.com>2013-05-16 12:53:59 -0700
commit84cf246670eab56a23ed5554ed084053a0f19f2d (patch)
treefd5ec6b225cd139eb0e8132dbb3cf1981d7ee271 /revision.h
parent6a3ac18ba3150a7e089c0c6b6648b364c71f87c9 (diff)
downloadgit-84cf246670eab56a23ed5554ed084053a0f19f2d.tar.gz
git-84cf246670eab56a23ed5554ed084053a0f19f2d.tar.xz
strbuf_branchname(): do not double-expand @{-1}~22
If you were on 'frotz' branch before you checked out your current branch, "git merge @{-1}~22" means the same as "git merge frotz~22". The strbuf_branchname() function, when interpret_branch_name() gives up resolving "@{-1}~22" fully, returns "frotz" and tells the caller that it only resolved "@{-1}" part of the input, mistakes this as a total failure, and appends the whole thing to the result, yielding "frotz@{-1}~22", which does not make any sense. Inspect the return value from interpret_branch_name() a bit more carefully. When it errored out without consuming anything, we will get -1 and we should return the whole thing. Otherwise, we should append the remainder (i.e. "~22" in the earlier example) to the partially resolved name (i.e. "frotz"). The test suite adds enough number of checkout to make @{-12} in the last test in t0100 that tried to check "we haven't flipped branches that many times" error case succeed; raise the number to a hundred. Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'revision.h')
0 files changed, 0 insertions, 0 deletions