summaryrefslogtreecommitdiff
path: root/t/t0008-ignores.sh
diff options
context:
space:
mode:
authorLibravatar Junio C Hamano <gitster@pobox.com>2020-03-17 15:02:23 -0700
committerLibravatar Junio C Hamano <gitster@pobox.com>2020-03-17 15:02:23 -0700
commit16a4bf10359edf34a7c62d6466dab2e33060d332 (patch)
tree109910396fb1d1f2339976bb23532f8306446f03 /t/t0008-ignores.sh
parentMerge branch 'jk/push-option-doc-markup-fix' into maint (diff)
parentcheck-ignore: fix documentation and implementation to match (diff)
downloadtgif-16a4bf10359edf34a7c62d6466dab2e33060d332.tar.xz
Merge branch 'en/check-ignore' into maint
"git check-ignore" did not work when the given path is explicitly marked as not ignored with a negative entry in the .gitignore file. * en/check-ignore: check-ignore: fix documentation and implementation to match
Diffstat (limited to 't/t0008-ignores.sh')
-rwxr-xr-xt/t0008-ignores.sh39
1 files changed, 23 insertions, 16 deletions
diff --git a/t/t0008-ignores.sh b/t/t0008-ignores.sh
index 1744cee5e9..370a389e5c 100755
--- a/t/t0008-ignores.sh
+++ b/t/t0008-ignores.sh
@@ -424,9 +424,24 @@ test_expect_success 'local ignore inside a sub-directory with --verbose' '
)
'
-test_expect_success_multi 'nested include' \
- 'a/b/.gitignore:8:!on* a/b/one' '
- test_check_ignore "a/b/one"
+test_expect_success 'nested include of negated pattern' '
+ expect "" &&
+ test_check_ignore "a/b/one" 1
+'
+
+test_expect_success 'nested include of negated pattern with -q' '
+ expect "" &&
+ test_check_ignore "-q a/b/one" 1
+'
+
+test_expect_success 'nested include of negated pattern with -v' '
+ expect "a/b/.gitignore:8:!on* a/b/one" &&
+ test_check_ignore "-v a/b/one" 0
+'
+
+test_expect_success 'nested include of negated pattern with -v -n' '
+ expect "a/b/.gitignore:8:!on* a/b/one" &&
+ test_check_ignore "-v -n a/b/one" 0
'
############################################################################
@@ -460,7 +475,6 @@ test_expect_success 'cd to ignored sub-directory' '
expect_from_stdin <<-\EOF &&
foo
twoooo
- ../one
seven
../../one
EOF
@@ -543,7 +557,6 @@ test_expect_success 'global ignore' '
globalthree
a/globalthree
a/per-repo
- globaltwo
EOF
test_check_ignore "globalone per-repo globalthree a/globalthree a/per-repo not-ignored globaltwo"
'
@@ -586,17 +599,7 @@ EOF
cat <<-\EOF >expected-default
one
a/one
- a/b/on
- a/b/one
- a/b/one one
- a/b/one two
- "a/b/one\"three"
- a/b/two
a/b/twooo
- globaltwo
- a/globaltwo
- a/b/globaltwo
- b/globaltwo
EOF
cat <<-EOF >expected-verbose
.gitignore:1:one one
@@ -696,8 +699,12 @@ cat <<-EOF >expected-all
$global_excludes:2:!globaltwo ../b/globaltwo
:: c/not-ignored
EOF
+cat <<-EOF >expected-default
+../one
+one
+b/twooo
+EOF
grep -v '^:: ' expected-all >expected-verbose
-sed -e 's/.* //' expected-verbose >expected-default
broken_c_unquote stdin >stdin0