Skip to content

Commit

Permalink
t5000, t5003: create directories for extracted files lazily
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
René Scharfe authored and Junio C Hamano committed May 20, 2013
1 parent c420df7 commit 1355241
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions t/t5000-tar-tree.sh
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ SUBSTFORMAT=%H%n

test_expect_success \
'populate workdir' \
'mkdir a b c &&
'mkdir a &&
echo simple textfile >a/a &&
mkdir a/bin &&
cp /bin/sh a/bin &&
Expand Down Expand Up @@ -126,7 +126,7 @@ test_expect_success \

test_expect_success \
'extract tar archive' \
'(cd b && "$TAR" xf -) <b.tar'
'(mkdir b && cd b && "$TAR" xf -) <b.tar'

test_expect_success \
'validate filenames' \
Expand All @@ -143,7 +143,7 @@ test_expect_success \

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

test_expect_success \
'validate filenames with prefix' \
Expand Down
2 changes: 1 addition & 1 deletion t/t5003-archive-zip.sh
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ check_zip() {

test_expect_success \
'populate workdir' \
'mkdir a b c &&
'mkdir a &&
echo simple textfile >a/a &&
mkdir a/bin &&
cp /bin/sh a/bin &&
Expand Down

0 comments on commit 1355241

Please sign in to comment.