git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH 2/6] t5000, t5003: create directories for extracted files lazily

From
René Scharfe <rene.scharfe@lsrfire.ath.cx>
Date
May 20, 2013, 09:58 UTC
Message-ID
<1369043909-59207-3-git-send-email-rene.scharfe@lsrfire.ath.cx>
In-Reply-To
<1369043909-59207-1-git-send-email-rene.scharfe@lsrfire.ath.cx>

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>
---
 t/t5000-tar-tree.sh    | 6 +++---
 t/t5003-archive-zip.sh | 2 +-
 2 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/t/t5000-tar-tree.sh b/t/t5000-tar-tree.sh
index 68b5698..41cd609 100755
--- a/t/t5000-tar-tree.sh
+++ b/t/t5000-tar-tree.sh
@@ -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' \
diff --git a/t/t5003-archive-zip.sh b/t/t5003-archive-zip.sh
index 4e7b05d..c72f71e 100755
--- a/t/t5003-archive-zip.sh
+++ b/t/t5003-archive-zip.sh
@@ -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 &&
-- 
1.8.2.3
Previous: René ScharfeNext: René Scharfe
Message 5 of 15 in “t5000: add test for pax extended header generation”
  1. 0/6 t5000: add test for pax extended header generationRené Scharfe, May 20, 2013
  2. 1/6 t5000: integrate export-subst tests into regular testsRené Scharfe, May 20, 2013
  3. Eric SunshineMay 20, 2013
  4. René ScharfeMay 20, 2013
  5. 2/6 t5000, t5003: create directories for extracted files lazilyRené Scharfe, May 20, 2013
  6. 3/6 t5000: factor out check_tarRené Scharfe, May 20, 2013
  7. Eric SunshineMay 20, 2013
  8. René ScharfeMay 20, 2013
  9. 4/6 t5000: use check_tar for prefix testRené Scharfe, May 20, 2013
  10. 5/6 t5000: simplify tar-tree testsRené Scharfe, May 20, 2013
  11. 6/6 t5000: test long filenamesRené Scharfe, May 20, 2013
  12. Eric SunshineMay 20, 2013
  13. (unknown)Marty Landman, May 20, 2013
  14. René ScharfeMay 20, 2013
  15. Junio C HamanoMay 20, 2013

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.