Skip to content

Commit d0dcece

Browse files
committed
t9391: guard dos2unix use behind a prereq
Not all setups have `dos2unix`. Most notably, the Ubuntu and macOS agents of GitHub Actions don't. Signed-off-by: Johannes Schindelin <[email protected]>
1 parent 85afdf9 commit d0dcece

File tree

1 file changed

+12
-4
lines changed

1 file changed

+12
-4
lines changed

t/t9391-filter-repo-lib-usage.sh

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -164,6 +164,11 @@ test_expect_success 'other error cases' '
164164
)
165165
'
166166

167+
test_lazy_prereq DOS2UNIX '
168+
dos2unix -h
169+
test $? -ne 127
170+
'
171+
167172
test_expect_success 'lint-history' '
168173
test_create_repo lint-history &&
169174
(
@@ -181,10 +186,13 @@ test_expect_success 'lint-history' '
181186
git add content &&
182187
git commit -m "oops, that was embarassing" &&
183188
184-
$CONTRIB_DIR/lint-history --filenames-important dos2unix &&
185-
echo 2 >expect &&
186-
git rev-list --count HEAD >actual &&
187-
test_cmp expect actual
189+
if test_have_prereq DOS2UNIX
190+
then
191+
$CONTRIB_DIR/lint-history --filenames-important dos2unix &&
192+
echo 2 >expect &&
193+
git rev-list --count HEAD >actual &&
194+
test_cmp expect actual
195+
fi
188196
)
189197
'
190198

0 commit comments

Comments
 (0)