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 <rene.scharfe@lsrfire.ath.cx> Signed-off-by: Junio C Hamano <gitster@pobox.com>
René Scharfe committed
May 20, 2013 at 11:58 UTC
0a00ee58446e3a74e480057059a877da9c857346
1 file changed
+8
-23
t/t5000-tar-tree.sh
+8
-23
@@ -115,14 +115,6 @@ test_expect_success 'git-archive --prefix=olde-' '
115
116
check_tar with_olde-prefix olde-
117
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
-
118
test_expect_success 'git archive on large files' '
119
test_config core.bigfilethreshold 1 &&
120
git archive HEAD >b3.tar &&
@@ -158,22 +150,15 @@ test_expect_success \
150
'git get-tar-commit-id <b.tar >b.commitid &&
151
test_cmp .git/$(git symbolic-ref HEAD) b.commitid'
152
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
+'
157
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
+'
162
163
test_expect_success 'git archive with --output, override inferred format' '
164
git archive --format=tar --output=d4.zip HEAD &&