From f838ce5826a2deffff7b70986fc7392d7114013e Mon Sep 17 00:00:00 2001 From: Jeff King Date: Sun, 10 Mar 2013 21:31:47 -0400 Subject: [PATCH] test-lib: factor out $GIT_UNZIP setup We set up the $GIT_UNZIP variable and lazy prereq in multiple places (and the next patch is about to add another one). Let's factor it out to avoid repeating ourselves. Signed-off-by: Jeff King Signed-off-by: Junio C Hamano --- t/t0024-crlf-archive.sh | 6 ------ t/t5003-archive-zip.sh | 6 ------ t/test-lib.sh | 6 ++++++ 3 files changed, 6 insertions(+), 12 deletions(-) diff --git a/t/t0024-crlf-archive.sh b/t/t0024-crlf-archive.sh index 5378787e1b..4e9fa3cd68 100755 --- a/t/t0024-crlf-archive.sh +++ b/t/t0024-crlf-archive.sh @@ -3,12 +3,6 @@ test_description='respect crlf in git archive' . ./test-lib.sh -GIT_UNZIP=${GIT_UNZIP:-unzip} - -test_lazy_prereq UNZIP ' - "$GIT_UNZIP" -v - test $? -ne 127 -' test_expect_success setup ' diff --git a/t/t5003-archive-zip.sh b/t/t5003-archive-zip.sh index 7cfe9ca3da..0f5b42b8ed 100755 --- a/t/t5003-archive-zip.sh +++ b/t/t5003-archive-zip.sh @@ -3,15 +3,9 @@ test_description='git archive --format=zip test' . ./test-lib.sh -GIT_UNZIP=${GIT_UNZIP:-unzip} SUBSTFORMAT=%H%n -test_lazy_prereq UNZIP ' - "$GIT_UNZIP" -v - test $? -ne 127 -' - test_lazy_prereq UNZIP_SYMLINKS ' ( mkdir unzip-symlinks && diff --git a/t/test-lib.sh b/t/test-lib.sh index ea1e4a03a7..e20fc69922 100644 --- a/t/test-lib.sh +++ b/t/test-lib.sh @@ -750,3 +750,9 @@ test_lazy_prereq AUTOIDENT ' # When the tests are run as root, permission tests will report that # things are writable when they shouldn't be. test -w / || test_set_prereq SANITY + +GIT_UNZIP=${GIT_UNZIP:-unzip} +test_lazy_prereq UNZIP ' + "$GIT_UNZIP" -v + test $? -ne 127 +' -- 2.11.4.GIT