t5000: use check_tar for prefix test
Perform the full range of checks against all archived files instead of looking only at the file type of a few of them. Also add a test of a git archive with a prefix ending in with a slash, i.e. adding a full directory level. 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
03d9bc564b3e87a2cdf4d511c8707a2de54ee6c6
1 file changed
+12
-12
t/t5000-tar-tree.sh
+12
-12
@@ -103,6 +103,18 @@ test_expect_success \
103
104
check_tar b
105
106
+test_expect_success 'git archive --prefix=prefix/' '
107
+ git archive --prefix=prefix/ HEAD >with_prefix.tar
108
+'
109
+
110
+check_tar with_prefix prefix/
111
+
112
+test_expect_success 'git-archive --prefix=olde-' '
113
+ git archive --prefix=olde- HEAD >with_olde-prefix.tar
114
+'
115
+
116
+check_tar with_olde-prefix olde-
117
+
118
test_expect_success \
119
'git tar-tree' \
120
'git tar-tree HEAD >b2.tar'
@@ -180,18 +192,6 @@ test_expect_success 'clients cannot access unreachable commits' '
192
test_must_fail git archive --remote=. $sha1 >remote.tar
193
'
194
183
-test_expect_success 'git-archive --prefix=olde-' '
184
- git archive --prefix=olde- >h.tar HEAD &&
185
- (
186
- mkdir h &&
187
- cd h &&
188
- "$TAR" xf - <../h.tar
189
- ) &&
190
- test -d h/olde-a &&
191
- test -d h/olde-a/bin &&
192
- test -f h/olde-a/bin/sh
193
-'
194
-
195
test_expect_success 'setup tar filters' '
196
git config tar.tar.foo.command "tr ab ba" &&
197
git config tar.bar.command "tr ab ba" &&