Skip to content

Commit 03d9bc5

Browse files
René Scharfegitster
authored andcommitted
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 <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent deb9c8e commit 03d9bc5

File tree

1 file changed

+12
-12
lines changed

1 file changed

+12
-12
lines changed

t/t5000-tar-tree.sh

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,18 @@ test_expect_success \
103103

104104
check_tar b
105105

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+
106118
test_expect_success \
107119
'git tar-tree' \
108120
'git tar-tree HEAD >b2.tar'
@@ -180,18 +192,6 @@ test_expect_success 'clients cannot access unreachable commits' '
180192
test_must_fail git archive --remote=. $sha1 >remote.tar
181193
'
182194

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-
195195
test_expect_success 'setup tar filters' '
196196
git config tar.tar.foo.command "tr ab ba" &&
197197
git config tar.bar.command "tr ab ba" &&

0 commit comments

Comments
 (0)