Skip to content

Commit f838ce5

Browse files
peffgitster
authored andcommitted
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 <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent ca70c9e commit f838ce5

File tree

3 files changed

+6
-12
lines changed

3 files changed

+6
-12
lines changed

t/t0024-crlf-archive.sh

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,6 @@
33
test_description='respect crlf in git archive'
44

55
. ./test-lib.sh
6-
GIT_UNZIP=${GIT_UNZIP:-unzip}
7-
8-
test_lazy_prereq UNZIP '
9-
"$GIT_UNZIP" -v
10-
test $? -ne 127
11-
'
126

137
test_expect_success setup '
148

t/t5003-archive-zip.sh

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,9 @@
33
test_description='git archive --format=zip test'
44

55
. ./test-lib.sh
6-
GIT_UNZIP=${GIT_UNZIP:-unzip}
76

87
SUBSTFORMAT=%H%n
98

10-
test_lazy_prereq UNZIP '
11-
"$GIT_UNZIP" -v
12-
test $? -ne 127
13-
'
14-
159
test_lazy_prereq UNZIP_SYMLINKS '
1610
(
1711
mkdir unzip-symlinks &&

t/test-lib.sh

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -750,3 +750,9 @@ test_lazy_prereq AUTOIDENT '
750750
# When the tests are run as root, permission tests will report that
751751
# things are writable when they shouldn't be.
752752
test -w / || test_set_prereq SANITY
753+
754+
GIT_UNZIP=${GIT_UNZIP:-unzip}
755+
test_lazy_prereq UNZIP '
756+
"$GIT_UNZIP" -v
757+
test $? -ne 127
758+
'

0 commit comments

Comments
 (0)