aboutsummaryrefslogtreecommitdiff
path: root/t/t4208-log-magic-pathspec.sh
diff options
context:
space:
mode:
authorNguyễn Thái Ngọc Duy <pclouds@gmail.com>2011-05-08 18:08:26 +0700
committerJunio C Hamano <gitster@pobox.com>2011-05-10 12:42:59 -0700
commit6fd09f537c7a1b0a92587aa6f00ef7302a546a1e (patch)
tree029eaf5faf11a634b4d53f3a0ae6b6dada42b7ed /t/t4208-log-magic-pathspec.sh
parent0e539dca51c298ca2ee102e0ca118797f2da99eb (diff)
downloadgit-6fd09f537c7a1b0a92587aa6f00ef7302a546a1e.tar.gz
git-6fd09f537c7a1b0a92587aa6f00ef7302a546a1e.tar.xz
t3703, t4208: add test cases for magic pathspec
Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com> 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.sh36
1 files changed, 36 insertions, 0 deletions
diff --git a/t/t4208-log-magic-pathspec.sh b/t/t4208-log-magic-pathspec.sh
new file mode 100755
index 000000000..2c482b622
--- /dev/null
+++ b/t/t4208-log-magic-pathspec.sh
@@ -0,0 +1,36 @@
+#!/bin/sh
+
+test_description='magic pathspec tests using git-log'
+
+. ./test-lib.sh
+
+test_expect_success 'setup' '
+ test_commit initial &&
+ test_tick &&
+ git commit --allow-empty -m empty &&
+ mkdir sub
+'
+
+test_expect_success '"git log :/" should be ambiguous' '
+ test_must_fail git log :/ 2>error &&
+ grep ambiguous error
+'
+
+test_expect_success '"git log :" should be ambiguous' '
+ test_must_fail git log : 2>error &&
+ grep ambiguous error
+'
+
+test_expect_success 'git log -- :' '
+ git log -- :
+'
+
+test_expect_success 'git log HEAD -- :/' '
+ cat >expected <<-EOF &&
+ 24b24cf initial
+ EOF
+ (cd sub && git log --oneline HEAD -- :/ >../actual) &&
+ test_cmp expected actual
+'
+
+test_done