Skip to content

Commit

Permalink
test-lib: factor out $GIT_UNZIP setup
Browse files Browse the repository at this point in the history
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 <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
  • Loading branch information
Jeff King authored and Junio C Hamano committed Mar 11, 2013
1 parent ca70c9e commit f838ce5
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 12 deletions.
6 changes: 0 additions & 6 deletions t/t0024-crlf-archive.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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 '
Expand Down
6 changes: 0 additions & 6 deletions t/t5003-archive-zip.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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 &&
Expand Down
6 changes: 6 additions & 0 deletions t/test-lib.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
'

0 comments on commit f838ce5

Please sign in to comment.