Skip to content

Commit dbbb8c5

Browse files
avargitster
authored andcommitted
t0008: don't rely on default ".git/info/exclude"
Change a test added in 368aa52 (add git-check-ignore sub-command, 2013-01-06) to clobber .git/info/exclude rather than append to it. These tests would break if the "templates/info--exclude" file added in d3af621 (Redo the templates generation and installation., 2005-08-06) wasn't exactly 6 lines (of only comments). Let's instead clobber the default .git/info/excludes file, and test only our own expected content. This is not strictly needed for anything in this series, but is a good cleanup while we're at it. As discussed in the preceding commit a lot of things depend on the "info" directory being created, but this was the only test that relied on the specific content in the "templates/info--exclude" file. Signed-off-by: Ævar Arnfjörð Bjarmason <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent e54793a commit dbbb8c5

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

t/t0008-ignores.sh

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,7 @@ test_expect_success 'setup' '
225225
!globaltwo
226226
globalthree
227227
EOF
228-
cat <<-\EOF >>.git/info/exclude
228+
cat <<-\EOF >.git/info/exclude
229229
per-repo
230230
EOF
231231
'
@@ -543,9 +543,9 @@ test_expect_success_multi 'submodule from subdirectory' '' '
543543

544544
test_expect_success 'global ignore not yet enabled' '
545545
expect_from_stdin <<-\EOF &&
546-
.git/info/exclude:7:per-repo per-repo
546+
.git/info/exclude:1:per-repo per-repo
547547
a/.gitignore:2:*three a/globalthree
548-
.git/info/exclude:7:per-repo a/per-repo
548+
.git/info/exclude:1:per-repo a/per-repo
549549
EOF
550550
test_check_ignore "-v globalone per-repo a/globalthree a/per-repo not-ignored a/globaltwo"
551551
'
@@ -566,10 +566,10 @@ test_expect_success 'global ignore with -v' '
566566
enable_global_excludes &&
567567
expect_from_stdin <<-EOF &&
568568
$global_excludes:1:globalone globalone
569-
.git/info/exclude:7:per-repo per-repo
569+
.git/info/exclude:1:per-repo per-repo
570570
$global_excludes:3:globalthree globalthree
571571
a/.gitignore:2:*three a/globalthree
572-
.git/info/exclude:7:per-repo a/per-repo
572+
.git/info/exclude:1:per-repo a/per-repo
573573
$global_excludes:2:!globaltwo globaltwo
574574
EOF
575575
test_check_ignore "-v globalone per-repo globalthree a/globalthree a/per-repo not-ignored globaltwo"

0 commit comments

Comments
 (0)