]> git.ipfire.org Git - thirdparty/git.git/commitdiff
t5000, t5003: create directories for extracted files lazily
authorRené Scharfe <rene.scharfe@lsrfire.ath.cx>
Mon, 20 May 2013 09:58:25 +0000 (11:58 +0200)
committerJunio C Hamano <gitster@pobox.com>
Mon, 20 May 2013 22:31:45 +0000 (15:31 -0700)
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>
t/t5000-tar-tree.sh
t/t5003-archive-zip.sh

index 68b5698d29d40f61b70f5dadfc51e053c9cbfb85..41cd6094acaff635a19ad58416c0603affe25f79 100755 (executable)
@@ -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 &&
@@ -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' \
@@ -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' \
index 4e7b05dd2391125b1c9e58404c552647107099cd..c72f71eb18ee90b7885ea2af574e1115154a5549 100755 (executable)
@@ -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 &&