Skip to content

Commit 1355241

Browse files
René Scharfegitster
authored andcommitted
t5000, t5003: create directories for extracted files lazily
Create the directories b and c just before they are needed instead of up front. For t5003 it turns out we don't need them at all. For t5000 it makes the coming modifications easier. Signed-off-by: René Scharfe <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent c420df7 commit 1355241

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

t/t5000-tar-tree.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ SUBSTFORMAT=%H%n
3232

3333
test_expect_success \
3434
'populate workdir' \
35-
'mkdir a b c &&
35+
'mkdir a &&
3636
echo simple textfile >a/a &&
3737
mkdir a/bin &&
3838
cp /bin/sh a/bin &&
@@ -126,7 +126,7 @@ test_expect_success \
126126

127127
test_expect_success \
128128
'extract tar archive' \
129-
'(cd b && "$TAR" xf -) <b.tar'
129+
'(mkdir b && cd b && "$TAR" xf -) <b.tar'
130130

131131
test_expect_success \
132132
'validate filenames' \
@@ -143,7 +143,7 @@ test_expect_success \
143143

144144
test_expect_success \
145145
'extract tar archive with prefix' \
146-
'(cd c && "$TAR" xf -) <c.tar'
146+
'(mkdir c && cd c && "$TAR" xf -) <c.tar'
147147

148148
test_expect_success \
149149
'validate filenames with prefix' \

t/t5003-archive-zip.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ check_zip() {
3737

3838
test_expect_success \
3939
'populate workdir' \
40-
'mkdir a b c &&
40+
'mkdir a &&
4141
echo simple textfile >a/a &&
4242
mkdir a/bin &&
4343
cp /bin/sh a/bin &&

0 commit comments

Comments
 (0)