Skip to content

Commit 003f69b

Browse files
peffgitster
authored andcommitted
t1300: use test_must_fail as appropriate
Some of the tests checked the exit code manually, even going so far as to run git outside of the test_expect harness. Signed-off-by: Jeff King <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent c2e9364 commit 003f69b

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

t/t1300-repo-config.sh

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -336,10 +336,10 @@ test_expect_success 'get bool variable with empty value' \
336336
'git config --bool emptyvalue.variable > output &&
337337
cmp output expect'
338338

339-
git config > output 2>&1
340-
341-
test_expect_success 'no arguments, but no crash' \
342-
"test $? = 129 && grep usage output"
339+
test_expect_success 'no arguments, but no crash' '
340+
test_must_fail git config >output 2>&1 &&
341+
grep usage output
342+
'
343343

344344
cat > .git/config << EOF
345345
[a.b]
@@ -373,7 +373,7 @@ EOF
373373
test_expect_success 'new variable inserts into proper section' 'cmp .git/config expect'
374374

375375
test_expect_success 'alternative GIT_CONFIG (non-existing file should fail)' \
376-
'git config --file non-existing-config -l; test $? != 0'
376+
'test_must_fail git config --file non-existing-config -l'
377377

378378
cat > other-config << EOF
379379
[ein]

0 commit comments

Comments
 (0)