summaryrefslogtreecommitdiff
path: root/notes-cache.h
diff options
context:
space:
mode:
authorLibravatar Jeff King <peff@peff.net>2014-01-15 03:40:46 -0500
committerLibravatar Junio C Hamano <gitster@pobox.com>2014-01-15 12:51:14 -0800
commit9892d5d4541d93a8a6a4fd9ac4178d71d0d308e3 (patch)
treef0651d3a363ca45a146e6c24ee5ed7f79c71660f /notes-cache.h
parentinterpret_branch_name: avoid @{upstream} past colon (diff)
downloadtgif-9892d5d4541d93a8a6a4fd9ac4178d71d0d308e3.tar.xz
interpret_branch_name: find all possible @-marks
When we parse a string like "foo@{upstream}", we look for the first "@"-sign, and check to see if it is an upstream mark. However, since branch names can contain an @, we may also see "@foo@{upstream}". In this case, we check only the first @, and ignore the second. As a result, we do not find the upstream. We can solve this by iterating through all @-marks in the string, and seeing if any is a legitimate upstream or empty-at mark. Another strategy would be to parse from the right-hand side of the string. However, that does not work for the "empty_at" case, which allows "@@{upstream}". We need to find the left-most one in this case (and we then recurse as "HEAD@{upstream}"). Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'notes-cache.h')
0 files changed, 0 insertions, 0 deletions