summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: d46a830)
raw | patch | inline | side by side (parent: d46a830)
author | Jeff King <peff@peff.net> | |
Thu, 28 Jan 2010 09:56:43 +0000 (04:56 -0500) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Thu, 28 Jan 2010 20:12:50 +0000 (12:12 -0800) |
Something like foo@{-1} is nonsensical, as the @{-N} syntax
is reserved for "the Nth last branch", and is not an actual
reflog selector. We should not feed such nonsense to
approxidate at all.
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
is reserved for "the Nth last branch", and is not an actual
reflog selector. We should not feed such nonsense to
approxidate at all.
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
sha1_name.c | patch | blob | history | |
t/t1508-at-combinations.sh | patch | blob | history |
diff --git a/sha1_name.c b/sha1_name.c
index 00fc4151780a4e66b70a78ac30d4798ad69b976e..77299257bf3aa91079d5b883c6676afa6fd2d01c 100644 (file)
--- a/sha1_name.c
+++ b/sha1_name.c
unsigned long co_time;
int co_tz, co_cnt;
+ /* a @{-N} placed anywhere except the start is an error */
+ if (str[at+2] == '-')
+ return -1;
+
/* Is it asking for N-th entry, or approxidate? */
for (i = nth = 0; 0 <= nth && i < reflog_len; i++) {
char ch = str[at+2+i];
index 2a46af24d6ae76dd057a88960a815c53b526d1b8..d5d6244178137cddc985ad4fc32ee3e78c7c5746 100755 (executable)
check "@{u}@{1}" upstream-one
check "@{-1}@{u}" master-two
check "@{-1}@{u}@{1}" master-one
-fail nonsense "@{u}@{-1}"
+nonsense "@{u}@{-1}"
nonsense "@{1}@{u}"
test_done