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 <rene.scharfe@lsrfire.ath.cx> Signed-off-by: Junio C Hamano <gitster@pobox.com>
René Scharfe committed
May 20, 2013 at 11:58 UTC
1355241bf58b325ec9bedc2768d28dd20355c50e
2 files changed
+4
-4
t/t5000-tar-tree.sh
+3
-3
@@ -32,7 +32,7 @@ SUBSTFORMAT=%H%n
32
33
test_expect_success \
34
'populate workdir' \
35
- 'mkdir a b c &&
35
+ 'mkdir a &&
36
echo simple textfile >a/a &&
37
mkdir a/bin &&
38
cp /bin/sh a/bin &&
@@ -126,7 +126,7 @@ test_expect_success \
126
127
test_expect_success \
128
'extract tar archive' \
129
- '(cd b && "$TAR" xf -) <b.tar'
129
+ '(mkdir b && cd b && "$TAR" xf -) <b.tar'
130
131
test_expect_success \
132
'validate filenames' \
@@ -143,7 +143,7 @@ test_expect_success \
143
144
test_expect_success \
145
'extract tar archive with prefix' \
146
- '(cd c && "$TAR" xf -) <c.tar'
146
+ '(mkdir c && cd c && "$TAR" xf -) <c.tar'
147
148
test_expect_success \
149
'validate filenames with prefix' \
t/t5003-archive-zip.sh
+1
-1
@@ -37,7 +37,7 @@ check_zip() {
37
38
test_expect_success \
39
'populate workdir' \
40
- 'mkdir a b c &&
40
+ 'mkdir a &&
41
echo simple textfile >a/a &&
42
mkdir a/bin &&
43
cp /bin/sh a/bin &&