t4208: add check for ":/" without matching file
The DWIM magic in check_filename() doesn't just recognize ":/". It actually makes sure that the file it points to exists. t4208 checks only the case where the path is present, not the opposite. Since the next patches will be touching this area, let's add a test to make sure it continues working. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Jeff King committed
May 26, 2017 at 15:06 UTC
be6ed3f3346a24f4be2d771384528b1c87952b8f
1 file changed
+6
t/t4208-log-magic-pathspec.sh
+6
@@ -29,6 +29,12 @@ test_expect_success '"git log -- :/a" should not be ambiguous' '
29
git log -- :/a
30
'
31
32
+# This differs from the ":/a" check above in that :/in looks like a pathspec,
33
+# but doesn't match an actual file.
34
+test_expect_success '"git log :/in" should not be ambiguous' '
35
+ git log :/in
36
+'
37
+
38
test_expect_success '"git log :" should be ambiguous' '
39
test_must_fail git log : 2>error &&
40
test_i18ngrep ambiguous error