Skip to content

Commit ad94657

Browse files
René Scharfegitster
authored andcommitted
archive tests: do not use .gitattributes in working directory
We are interested in using archive mostly from a bare repository, so it should not add .gitattributes to the work tree. Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx> Signed-off-by: Junio C Hamano <gitster@pobox.com>
1 parent 55f0566 commit ad94657

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

t/t5000-tar-tree.sh

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ test_expect_success \
5050
test_expect_success \
5151
'add ignored file' \
5252
'echo ignore me >a/ignored &&
53-
echo ignored export-ignore >.gitattributes'
53+
echo ignored export-ignore >.git/info/attributes'
5454

5555
test_expect_success \
5656
'add files to repository' \
@@ -64,7 +64,7 @@ test_expect_success \
6464
test_expect_success \
6565
'create bare clone' \
6666
'git clone --bare . bare.git &&
67-
cp .gitattributes bare.git/info/attributes'
67+
cp .git/info/attributes bare.git/info/attributes'
6868

6969
test_expect_success \
7070
'remove ignored file' \
@@ -139,10 +139,11 @@ test_expect_success \
139139

140140
test_expect_success \
141141
'create archives with substfiles' \
142-
'echo "substfile?" export-subst >a/.gitattributes &&
142+
'cp .git/info/attributes .git/info/attributes.before &&
143+
echo "substfile?" export-subst >>.git/info/attributes &&
143144
git archive HEAD >f.tar &&
144145
git archive --prefix=prefix/ HEAD >g.tar &&
145-
rm a/.gitattributes'
146+
mv .git/info/attributes.before .git/info/attributes'
146147

147148
test_expect_success \
148149
'extract substfiles' \

0 commit comments

Comments
 (0)