3 test_description
=check-ignore
5 TEST_PASSES_SANITIZE_LEAK
=true
9 global_excludes
="global-excludes"
12 enable_global_excludes
() {
14 git config core.excludesfile
"$global_excludes"
18 dest
="$HOME/expected-$1" text
="$2"
21 >"$dest" # avoid newline
31 expect_from_stdin
() {
32 cat >"$HOME/expected-stdout"
37 expect_in stderr
"$1" &&
38 test_cmp
"$HOME/expected-stderr" "$HOME/stderr"
42 "$PERL_PATH" -pe 's/^"//; s/\\//; s/"$//; tr/\n/\0/' "$@"
45 broken_c_unquote_verbose
() {
46 "$PERL_PATH" -pe 's/ "/ /; s/\\//; s/"$//; tr/:\t\n/\0/' "$@"
51 if test_i18ngrep
"$regexp" "$HOME/stderr"
55 echo "didn't find /$regexp/ in $HOME/stderr"
61 stderr_empty_on_success
() {
63 if test $expect_code = 0
67 # If we expect failure then stderr might or might not be empty
68 # due to --quiet - the caller can check its contents
73 test_check_ignore
() {
74 args
="$1" expect_code
="${2:-0}" global_args
="$3"
77 rm -f "$HOME/stdout" "$HOME/stderr" "$HOME/cmd" &&
78 echo git
$global_args check-ignore
$quiet_opt $verbose_opt $non_matching_opt $no_index_opt $args \
80 echo "$expect_code" >"$HOME/expected-exit-code" &&
81 test_expect_code
"$expect_code" \
82 git
$global_args check-ignore
$quiet_opt $verbose_opt $non_matching_opt $no_index_opt $args \
83 >"$HOME/stdout" 2>"$HOME/stderr" &&
84 test_cmp
"$HOME/expected-stdout" "$HOME/stdout" &&
85 stderr_empty_on_success
"$expect_code"
88 # Runs the same code with 4 different levels of output verbosity:
90 # 1. with -q / --quiet
91 # 2. with default verbosity
92 # 3. with -v / --verbose
93 # 4. with -v / --verbose, *and* -n / --non-matching
95 # expecting success each time. Takes advantage of the fact that
96 # check-ignore --verbose output is the same as normal output except
97 # for the extra first column.
99 # A parameter is used to determine if the tests are run with the
100 # normal case (using the index), or with the --no-index option.
103 # - (optional) prereqs for this test, e.g. 'SYMLINKS'
105 # - output to expect from the fourth verbosity mode (the output
106 # from the other verbosity modes is automatically inferred
108 # - code to run (should invoke test_check_ignore)
109 # - index option: --index or --no-index
110 test_expect_success_multiple
() {
117 if test "$4" = "--index"
123 testname
="$1" expect_all
="$2" code
="$3"
125 expect_verbose
=$
( echo "$expect_all" |
grep -v '^:: ' )
126 expect
=$
( echo "$expect_verbose" |
sed -e 's/.* //' )
128 test_expect_success
$prereq "$testname${no_index_opt:+ with $no_index_opt}" '
133 # --quiet is only valid when a single pattern is passed
134 if test $
( echo "$expect_all" |
wc -l ) = 1
136 for quiet_opt
in '-q' '--quiet'
138 opts
="${no_index_opt:+$no_index_opt }$quiet_opt"
139 test_expect_success
$prereq "$testname${opts:+ with $opts}" "
147 for verbose_opt
in '-v' '--verbose'
149 for non_matching_opt
in '' '-n' '--non-matching'
151 if test -n "$non_matching_opt"
153 my_expect
="$expect_all"
155 my_expect
="$expect_verbose"
159 expect '$my_expect' &&
162 opts
="${no_index_opt:+$no_index_opt }$verbose_opt${non_matching_opt:+ $non_matching_opt}"
163 test_expect_success
$prereq "$testname${opts:+ with $opts}" "$test_code"
171 test_expect_success_multi
() {
172 test_expect_success_multiple
"$@" "--index"
175 test_expect_success_no_index_multi
() {
176 test_expect_success_multiple
"$@" "--no-index"
179 test_expect_success
'setup' '
181 mkdir -p a/b/ignored-dir a/submodule b &&
182 if test_have_prereq SYMLINKS
191 git commit -m"commit in submodule"
193 git add a/submodule &&
194 cat <<-\EOF >.gitignore &&
201 : >$dir/not-ignored &&
202 : >$dir/ignored-and-untracked &&
203 : >$dir/ignored-but-in-index || return 1
205 git add -f ignored-but-in-index a/ignored-but-in-index &&
206 cat <<-\EOF >a/.gitignore &&
210 cat <<-\EOF >a/b/.gitignore &&
213 # this comment should affect the line numbers
216 # and so should this blank line:
221 echo "seven" >a/b/ignored-dir/.gitignore &&
223 cat <<-\EOF >"$global_excludes" &&
228 cat <<-\EOF >>.git/info/exclude
233 ############################################################################
235 # test invalid inputs
237 test_expect_success_multi
'. corner-case' ':: .' '
238 test_check_ignore . 1
241 test_expect_success_multi
'empty command line' '' '
242 test_check_ignore "" 128 &&
243 stderr_contains "fatal: no path specified"
246 test_expect_success_multi
'--stdin with empty STDIN' '' '
247 test_check_ignore "--stdin" 1 </dev/null &&
251 test_expect_success
'-q with multiple args' '
253 test_check_ignore "-q one two" 128 &&
254 stderr_contains "fatal: --quiet is only valid with a single pathname"
257 test_expect_success
'--quiet with multiple args' '
259 test_check_ignore "--quiet one two" 128 &&
260 stderr_contains "fatal: --quiet is only valid with a single pathname"
263 for verbose_opt
in '-v' '--verbose'
265 for quiet_opt
in '-q' '--quiet'
267 test_expect_success
"$quiet_opt $verbose_opt" "
269 test_check_ignore '$quiet_opt $verbose_opt foo' 128 &&
270 stderr_contains 'fatal: cannot have both --quiet and --verbose'
275 test_expect_success
'--quiet with multiple args' '
277 test_check_ignore "--quiet one two" 128 &&
278 stderr_contains "fatal: --quiet is only valid with a single pathname"
281 test_expect_success_multi
'erroneous use of --' '' '
282 test_check_ignore "--" 128 &&
283 stderr_contains "fatal: no path specified"
286 test_expect_success_multi
'--stdin with superfluous arg' '' '
287 test_check_ignore "--stdin foo" 128 &&
288 stderr_contains "fatal: cannot specify pathnames with --stdin"
291 test_expect_success_multi
'--stdin -z with superfluous arg' '' '
292 test_check_ignore "--stdin -z foo" 128 &&
293 stderr_contains "fatal: cannot specify pathnames with --stdin"
296 test_expect_success_multi
'-z without --stdin' '' '
297 test_check_ignore "-z" 128 &&
298 stderr_contains "fatal: -z only makes sense with --stdin"
301 test_expect_success_multi
'-z without --stdin and superfluous arg' '' '
302 test_check_ignore "-z foo" 128 &&
303 stderr_contains "fatal: -z only makes sense with --stdin"
306 test_expect_success_multi
'needs work tree' '' '
309 test_check_ignore "foo" 128
311 stderr_contains "fatal: this operation must be run in a work tree"
314 ############################################################################
316 # test standard ignores
318 # First make sure that the presence of a file in the working tree
319 # does not impact results, but that the presence of a file in the
320 # index does unless the --no-index option is used.
322 for subdir
in '' 'a/'
328 where
="in subdir $subdir"
331 test_expect_success_multi
"non-existent file $where not ignored" \
332 ":: ${subdir}non-existent" \
333 "test_check_ignore '${subdir}non-existent' 1"
335 test_expect_success_no_index_multi
"non-existent file $where not ignored" \
336 ":: ${subdir}non-existent" \
337 "test_check_ignore '${subdir}non-existent' 1"
339 test_expect_success_multi
"non-existent file $where ignored" \
340 ".gitignore:1:one ${subdir}one" \
341 "test_check_ignore '${subdir}one'"
343 test_expect_success_no_index_multi
"non-existent file $where ignored" \
344 ".gitignore:1:one ${subdir}one" \
345 "test_check_ignore '${subdir}one'"
347 test_expect_success_multi
"existing untracked file $where not ignored" \
348 ":: ${subdir}not-ignored" \
349 "test_check_ignore '${subdir}not-ignored' 1"
351 test_expect_success_no_index_multi
"existing untracked file $where not ignored" \
352 ":: ${subdir}not-ignored" \
353 "test_check_ignore '${subdir}not-ignored' 1"
355 test_expect_success_multi
"existing tracked file $where not ignored" \
356 ":: ${subdir}ignored-but-in-index" \
357 "test_check_ignore '${subdir}ignored-but-in-index' 1"
359 test_expect_success_no_index_multi
"existing tracked file $where shown as ignored" \
360 ".gitignore:2:ignored-* ${subdir}ignored-but-in-index" \
361 "test_check_ignore '${subdir}ignored-but-in-index'"
363 test_expect_success_multi
"existing untracked file $where ignored" \
364 ".gitignore:2:ignored-* ${subdir}ignored-and-untracked" \
365 "test_check_ignore '${subdir}ignored-and-untracked'"
367 test_expect_success_no_index_multi
"existing untracked file $where ignored" \
368 ".gitignore:2:ignored-* ${subdir}ignored-and-untracked" \
369 "test_check_ignore '${subdir}ignored-and-untracked'"
371 test_expect_success_multi
"mix of file types $where" \
372 ":: ${subdir}non-existent
373 .gitignore:1:one ${subdir}one
374 :: ${subdir}not-ignored
375 :: ${subdir}ignored-but-in-index
376 .gitignore:2:ignored-* ${subdir}ignored-and-untracked" \
378 ${subdir}non-existent
381 ${subdir}ignored-but-in-index
382 ${subdir}ignored-and-untracked'
385 test_expect_success_no_index_multi
"mix of file types $where" \
386 ":: ${subdir}non-existent
387 .gitignore:1:one ${subdir}one
388 :: ${subdir}not-ignored
389 .gitignore:2:ignored-* ${subdir}ignored-but-in-index
390 .gitignore:2:ignored-* ${subdir}ignored-and-untracked" \
392 ${subdir}non-existent
395 ${subdir}ignored-but-in-index
396 ${subdir}ignored-and-untracked'
400 # Having established the above, from now on we mostly test against
401 # files which do not exist in the working tree or index.
403 test_expect_success
'sub-directory local ignore' '
404 expect "a/3-three" &&
405 test_check_ignore "a/3-three a/three-not-this-one"
408 test_expect_success
'sub-directory local ignore with --verbose' '
409 expect "a/.gitignore:2:*three a/3-three" &&
410 test_check_ignore "--verbose a/3-three a/three-not-this-one"
413 test_expect_success
'local ignore inside a sub-directory' '
417 test_check_ignore "3-three three-not-this-one"
420 test_expect_success
'local ignore inside a sub-directory with --verbose' '
421 expect "a/.gitignore:2:*three 3-three" &&
424 test_check_ignore "--verbose 3-three three-not-this-one"
428 test_expect_success
'nested include of negated pattern' '
430 test_check_ignore "a/b/one" 1
433 test_expect_success
'nested include of negated pattern with -q' '
435 test_check_ignore "-q a/b/one" 1
438 test_expect_success
'nested include of negated pattern with -v' '
439 expect "a/b/.gitignore:8:!on* a/b/one" &&
440 test_check_ignore "-v a/b/one" 0
443 test_expect_success
'nested include of negated pattern with -v -n' '
444 expect "a/b/.gitignore:8:!on* a/b/one" &&
445 test_check_ignore "-v -n a/b/one" 0
448 ############################################################################
450 # test ignored sub-directories
452 test_expect_success_multi
'ignored sub-directory' \
453 'a/b/.gitignore:5:ignored-dir/ a/b/ignored-dir' '
454 test_check_ignore "a/b/ignored-dir"
457 test_expect_success
'multiple files inside ignored sub-directory' '
458 expect_from_stdin <<-\EOF &&
460 a/b/ignored-dir/twoooo
461 a/b/ignored-dir/seven
463 test_check_ignore "a/b/ignored-dir/foo a/b/ignored-dir/twoooo a/b/ignored-dir/seven"
466 test_expect_success
'multiple files inside ignored sub-directory with -v' '
467 expect_from_stdin <<-\EOF &&
468 a/b/.gitignore:5:ignored-dir/ a/b/ignored-dir/foo
469 a/b/.gitignore:5:ignored-dir/ a/b/ignored-dir/twoooo
470 a/b/.gitignore:5:ignored-dir/ a/b/ignored-dir/seven
472 test_check_ignore "-v a/b/ignored-dir/foo a/b/ignored-dir/twoooo a/b/ignored-dir/seven"
475 test_expect_success
'cd to ignored sub-directory' '
476 expect_from_stdin <<-\EOF &&
483 cd a/b/ignored-dir &&
484 test_check_ignore "foo twoooo ../one seven ../../one"
488 test_expect_success
'cd to ignored sub-directory with -v' '
489 expect_from_stdin <<-\EOF &&
490 a/b/.gitignore:5:ignored-dir/ foo
491 a/b/.gitignore:5:ignored-dir/ twoooo
492 a/b/.gitignore:8:!on* ../one
493 a/b/.gitignore:5:ignored-dir/ seven
494 .gitignore:1:one ../../one
497 cd a/b/ignored-dir &&
498 test_check_ignore "-v foo twoooo ../one seven ../../one"
502 ############################################################################
504 # test handling of symlinks
506 test_expect_success_multi SYMLINKS
'symlink' ':: a/symlink' '
507 test_check_ignore "a/symlink" 1
510 test_expect_success_multi SYMLINKS
'beyond a symlink' '' '
511 test_check_ignore "a/symlink/foo" 128 &&
512 test_stderr "fatal: pathspec '\''a/symlink/foo'\'' is beyond a symbolic link"
515 test_expect_success_multi SYMLINKS
'beyond a symlink from subdirectory' '' '
518 test_check_ignore "symlink/foo" 128
520 test_stderr "fatal: pathspec '\''symlink/foo'\'' is beyond a symbolic link"
523 ############################################################################
525 # test handling of submodules
527 test_expect_success_multi
'submodule' '' '
528 test_check_ignore "a/submodule/one" 128 &&
529 test_stderr "fatal: Pathspec '\''a/submodule/one'\'' is in submodule '\''a/submodule'\''"
532 test_expect_success_multi
'submodule from subdirectory' '' '
535 test_check_ignore "submodule/one" 128
537 test_stderr "fatal: Pathspec '\''submodule/one'\'' is in submodule '\''a/submodule'\''"
540 ############################################################################
542 # test handling of global ignore files
544 test_expect_success
'global ignore not yet enabled' '
545 expect_from_stdin <<-\EOF &&
546 .git/info/exclude:7:per-repo per-repo
547 a/.gitignore:2:*three a/globalthree
548 .git/info/exclude:7:per-repo a/per-repo
550 test_check_ignore "-v globalone per-repo a/globalthree a/per-repo not-ignored a/globaltwo"
553 test_expect_success
'global ignore' '
554 enable_global_excludes &&
555 expect_from_stdin <<-\EOF &&
562 test_check_ignore "globalone per-repo globalthree a/globalthree a/per-repo not-ignored globaltwo"
565 test_expect_success
'global ignore with -v' '
566 enable_global_excludes &&
567 expect_from_stdin <<-EOF &&
568 $global_excludes:1:globalone globalone
569 .git/info/exclude:7:per-repo per-repo
570 $global_excludes:3:globalthree globalthree
571 a/.gitignore:2:*three a/globalthree
572 .git/info/exclude:7:per-repo a/per-repo
573 $global_excludes:2:!globaltwo globaltwo
575 test_check_ignore "-v globalone per-repo globalthree a/globalthree a/per-repo not-ignored globaltwo"
578 ############################################################################
600 cat <<-\
EOF >expected-default
605 cat <<-EOF >expected-verbose
607 .gitignore:1:one a/one
608 a/b/.gitignore:8:!on* a/b/on
609 a/b/.gitignore:8:!on* a/b/one
610 a/b/.gitignore:8:!on* a/b/one one
611 a/b/.gitignore:8:!on* a/b/one two
612 a/b/.gitignore:8:!on* "a/b/one\\"three"
613 a/b/.gitignore:9:!two a/b/two
614 a/.gitignore:1:two* a/b/twooo
615 $global_excludes:2:!globaltwo globaltwo
616 $global_excludes:2:!globaltwo a/globaltwo
617 $global_excludes:2:!globaltwo a/b/globaltwo
618 $global_excludes:2:!globaltwo b/globaltwo
621 broken_c_unquote stdin >stdin0
623 broken_c_unquote expected-default >expected-default0
625 broken_c_unquote_verbose expected-verbose >expected-verbose0
627 test_expect_success '--stdin' '
628 expect_from_stdin <expected-default &&
629 test_check_ignore "--stdin" <stdin
632 test_expect_success '--stdin -q' '
634 test_check_ignore "-q --stdin" <stdin
637 test_expect_success '--stdin -v' '
638 expect_from_stdin <expected-verbose &&
639 test_check_ignore "-v --stdin" <stdin
642 for opts in '--stdin -z' '-z --stdin'
644 test_expect_success "$opts" "
645 expect_from_stdin <expected-default0 &&
646 test_check_ignore '$opts' <stdin0
649 test_expect_success "$opts -q" "
651 test_check_ignore '-q $opts' <stdin0
654 test_expect_success "$opts -v" "
655 expect_from_stdin <expected-verbose0 &&
656 test_check_ignore '-v $opts' <stdin0
679 # N.B. we deliberately end STDIN with a non-matching pattern in order
680 # to test that the exit code indicates that one or more of the
681 # provided paths is ignored - in other words
, that it represents an
682 # aggregation of all the results, not just the final result.
684 cat <<-EOF >expected-all
685 .gitignore:1:one ../one
689 a/b/.gitignore:8:!on* b/on
690 a/b/.gitignore:8:!on* b/one
691 a/b/.gitignore:8:!on* b/one one
692 a/b/.gitignore:8:!on* b/one two
693 a/b/.gitignore:8:!on* "b/one\\"three"
694 a/b/.gitignore:9:!two b/two
696 a/.gitignore:1:two* b/twooo
697 $global_excludes:2:!globaltwo ../globaltwo
698 $global_excludes:2:!globaltwo globaltwo
699 $global_excludes:2:!globaltwo b/globaltwo
700 $global_excludes:2:!globaltwo ../b/globaltwo
703 cat <<-EOF >expected-default
708 grep -v '^:: ' expected-all
>expected-verbose
710 broken_c_unquote stdin
>stdin0
712 broken_c_unquote expected-default
>expected-default0
714 broken_c_unquote_verbose expected-verbose
>expected-verbose0
716 test_expect_success
'--stdin from subdirectory' '
717 expect_from_stdin <expected-default &&
720 test_check_ignore "--stdin" <../stdin
724 test_expect_success
'--stdin from subdirectory with -v' '
725 expect_from_stdin <expected-verbose &&
728 test_check_ignore "--stdin -v" <../stdin
732 test_expect_success
'--stdin from subdirectory with -v -n' '
733 expect_from_stdin <expected-all &&
736 test_check_ignore "--stdin -v -n" <../stdin
740 for opts
in '--stdin -z' '-z --stdin'
742 test_expect_success
"$opts from subdirectory" '
743 expect_from_stdin <expected-default0 &&
746 test_check_ignore "'"$opts"'" <../stdin0
750 test_expect_success
"$opts from subdirectory with -v" '
751 expect_from_stdin <expected-verbose0 &&
754 test_check_ignore "'"$opts"' -v" <../stdin0
759 test_expect_success PIPE
'streaming support for --stdin' '
761 (git check-ignore -n -v --stdin <in >out &) &&
763 # We cannot just "echo >in" because check-ignore would get EOF
764 # after echo exited; instead we open the descriptor in our
765 # shell, and then echo to the fd. We make sure to close it at
766 # the end, so that the subprocess does get EOF and dies
769 # Similarly, we must keep "out" open so that check-ignore does
770 # not ever get SIGPIPE trying to write to us. Not only would that
771 # produce incorrect results, but then there would be no writer on the
772 # other end of the pipe, and we would potentially block forever trying
776 test_when_finished "exec 9>&-" &&
777 test_when_finished "exec 8<&-" &&
780 echo "$response" | grep "^\.gitignore:1:one one" &&
783 echo "$response" | grep "^:: two"
786 test_expect_success
'existing file and directory' '
787 test_when_finished "rm one" &&
788 test_when_finished "rmdir top-level-dir" &&
790 mkdir top-level-dir &&
791 git check-ignore one top-level-dir >actual &&
793 grep top-level-dir actual
796 test_expect_success
'existing directory and file' '
797 test_when_finished "rm one" &&
798 test_when_finished "rmdir top-level-dir" &&
800 mkdir top-level-dir &&
801 git check-ignore top-level-dir one >actual &&
803 grep top-level-dir actual
806 test_expect_success
'exact prefix matching (with root)' '
807 test_when_finished rm -r a &&
808 mkdir -p a/git a/git-foo &&
809 touch a/git/foo a/git-foo/bar &&
810 echo /git/ >a/.gitignore &&
811 git check-ignore a/git a/git/foo a/git-foo a/git-foo/bar >actual &&
812 cat >expect <<-\EOF &&
816 test_cmp expect actual
819 test_expect_success
'exact prefix matching (without root)' '
820 test_when_finished rm -r a &&
821 mkdir -p a/git a/git-foo &&
822 touch a/git/foo a/git-foo/bar &&
823 echo git/ >a/.gitignore &&
824 git check-ignore a/git a/git/foo a/git-foo a/git-foo/bar >actual &&
825 cat >expect <<-\EOF &&
829 test_cmp expect actual
832 test_expect_success
'directories and ** matches' '
833 cat >.gitignore <<-\EOF &&
838 git check-ignore file \
839 data/file data/data1/file1 data/data1/file1.txt \
840 data/data2/file2 data/data2/file2.txt >actual &&
841 cat >expect <<-\EOF &&
846 test_cmp expect actual
849 ############################################################################
851 # test whitespace handling
853 test_expect_success
'trailing whitespace is ignored' '
855 >whitespace/trailing &&
856 >whitespace/untracked &&
857 echo "whitespace/trailing " >ignore &&
861 git ls-files -o -X ignore whitespace >actual 2>err &&
862 test_cmp expect actual &&
863 test_must_be_empty err
866 test_expect_success
!MINGW
'quoting allows trailing whitespace' '
869 >"whitespace/trailing " &&
870 >whitespace/untracked &&
871 echo "whitespace/trailing\\ \\ " >ignore &&
872 echo whitespace/untracked >expect &&
873 git ls-files -o -X ignore whitespace >actual 2>err &&
874 test_cmp expect actual &&
875 test_must_be_empty err
878 test_expect_success
!MINGW
,!CYGWIN
'correct handling of backslashes' '
881 >"whitespace/trailing 1 " &&
882 >"whitespace/trailing 2 \\\\" &&
883 >"whitespace/trailing 3 \\\\" &&
884 >"whitespace/trailing 4 \\ " &&
885 >"whitespace/trailing 5 \\ \\ " &&
886 >"whitespace/trailing 6 \\a\\" &&
887 >whitespace/untracked &&
888 sed -e "s/Z$//" >ignore <<-\EOF &&
889 whitespace/trailing 1 \ Z
890 whitespace/trailing 2 \\\\Z
891 whitespace/trailing 3 \\\\ Z
892 whitespace/trailing 4 \\\ Z
893 whitespace/trailing 5 \\ \\\ Z
894 whitespace/trailing 6 \\a\\Z
896 echo whitespace/untracked >expect &&
897 git ls-files -o -X ignore whitespace >actual 2>err &&
898 test_cmp expect actual &&
899 test_must_be_empty err
902 test_expect_success
'info/exclude trumps core.excludesfile' '
903 echo >>global-excludes usually-ignored &&
904 echo >>.git/info/exclude "!usually-ignored" &&
906 echo "?? usually-ignored" >expect &&
908 git status --porcelain usually-ignored >actual &&
909 test_cmp expect actual
912 test_expect_success SYMLINKS
'set up ignore file for symlink tests' '
914 rm -f .gitignore .git/info/exclude
917 test_expect_success SYMLINKS
'symlinks respected in core.excludesFile' '
918 test_when_finished "rm symlink" &&
919 ln -s ignore symlink &&
920 test_config core.excludesFile "$(pwd)/symlink" &&
922 git check-ignore file >actual 2>err &&
923 test_cmp expect actual &&
924 test_must_be_empty err
927 test_expect_success SYMLINKS
'symlinks respected in info/exclude' '
928 test_when_finished "rm .git/info/exclude" &&
929 ln -s ../../ignore .git/info/exclude &&
931 git check-ignore file >actual 2>err &&
932 test_cmp expect actual &&
933 test_must_be_empty err
936 test_expect_success SYMLINKS
'symlinks not respected in-tree' '
937 test_when_finished "rm .gitignore" &&
938 ln -s ignore .gitignore &&
940 ln -s ignore subdir/.gitignore &&
941 test_must_fail git check-ignore subdir/file >actual 2>err &&
942 test_must_be_empty actual &&
943 test_i18ngrep "unable to access.*gitignore" err