Skip to content

Commit 0a00ee5

Browse files
René Scharfegitster
authored andcommitted
t5000: simplify tar-tree tests
Just compare the archives created by git tar-tree with the ones created using git archive with the equivalent options, whose contents are checked already, instead of extracting them again. Signed-off-by: René Scharfe <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 03d9bc5 commit 0a00ee5

File tree

1 file changed

+8
-23
lines changed

1 file changed

+8
-23
lines changed

t/t5000-tar-tree.sh

Lines changed: 8 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -115,14 +115,6 @@ test_expect_success 'git-archive --prefix=olde-' '
115115

116116
check_tar with_olde-prefix olde-
117117

118-
test_expect_success \
119-
'git tar-tree' \
120-
'git tar-tree HEAD >b2.tar'
121-
122-
test_expect_success \
123-
'git archive vs. git tar-tree' \
124-
'test_cmp b.tar b2.tar'
125-
126118
test_expect_success 'git archive on large files' '
127119
test_config core.bigfilethreshold 1 &&
128120
git archive HEAD >b3.tar &&
@@ -158,22 +150,15 @@ test_expect_success \
158150
'git get-tar-commit-id <b.tar >b.commitid &&
159151
test_cmp .git/$(git symbolic-ref HEAD) b.commitid'
160152

161-
test_expect_success \
162-
'git tar-tree with prefix' \
163-
'git tar-tree HEAD prefix >c.tar'
164-
165-
test_expect_success \
166-
'extract tar archive with prefix' \
167-
'(mkdir c && cd c && "$TAR" xf -) <c.tar'
168-
169-
test_expect_success \
170-
'validate filenames with prefix' \
171-
'(cd c/prefix/a && find .) | sort >c.lst &&
172-
test_cmp a.lst c.lst'
153+
test_expect_success 'git tar-tree' '
154+
git tar-tree HEAD >tar-tree.tar &&
155+
test_cmp b.tar tar-tree.tar
156+
'
173157

174-
test_expect_success \
175-
'validate file contents with prefix' \
176-
'diff -r a c/prefix/a'
158+
test_expect_success 'git tar-tree with prefix' '
159+
git tar-tree HEAD prefix >tar-tree_with_prefix.tar &&
160+
test_cmp with_prefix.tar tar-tree_with_prefix.tar
161+
'
177162

178163
test_expect_success 'git archive with --output, override inferred format' '
179164
git archive --format=tar --output=d4.zip HEAD &&

0 commit comments

Comments
 (0)