summaryrefslogtreecommitdiff
path: root/t/t4208-log-magic-pathspec.sh
diff options
context:
space:
mode:
authorJeff King <peff@peff.net>2017-05-26 19:06:41 (GMT)
committerJunio C Hamano <gitster@pobox.com>2017-05-29 02:36:53 (GMT)
commitbe6ed3f3346a24f4be2d771384528b1c87952b8f (patch)
treee0f2fb7e164e1bf471a17748549b7245276ad41f /t/t4208-log-magic-pathspec.sh
parentb06d3643105c8758ed019125a4399cb7efdcce2c (diff)
downloadgit-be6ed3f3346a24f4be2d771384528b1c87952b8f.zip
git-be6ed3f3346a24f4be2d771384528b1c87952b8f.tar.gz
git-be6ed3f3346a24f4be2d771384528b1c87952b8f.tar.bz2
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>
Diffstat (limited to 't/t4208-log-magic-pathspec.sh')
-rwxr-xr-xt/t4208-log-magic-pathspec.sh6
1 files changed, 6 insertions, 0 deletions
diff --git a/t/t4208-log-magic-pathspec.sh b/t/t4208-log-magic-pathspec.sh
index 001343e..70bc641 100755
--- a/t/t4208-log-magic-pathspec.sh
+++ b/t/t4208-log-magic-pathspec.sh
@@ -29,6 +29,12 @@ test_expect_success '"git log -- :/a" should not be ambiguous' '
git log -- :/a
'
+# This differs from the ":/a" check above in that :/in looks like a pathspec,
+# but doesn't match an actual file.
+test_expect_success '"git log :/in" should not be ambiguous' '
+ git log :/in
+'
+
test_expect_success '"git log :" should be ambiguous' '
test_must_fail git log : 2>error &&
test_i18ngrep ambiguous error