Skip to content

Commit 551a3e6

Browse files
peffgitster
authored andcommitted
t: prefer "git config --file" to GIT_CONFIG with test_must_fail
This lets us get rid of an extra "env" invocation in the middle, and is slightly more readable. Signed-off-by: Jeff King <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 3cc6a6f commit 551a3e6

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

t/t1300-repo-config.sh

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -961,15 +961,15 @@ test_expect_success SYMLINKS 'symlinked configuration' '
961961
'
962962

963963
test_expect_success 'nonexistent configuration' '
964-
test_must_fail env GIT_CONFIG=doesnotexist git config --list &&
965-
test_must_fail env GIT_CONFIG=doesnotexist git config test.xyzzy
964+
test_must_fail git config --file=doesnotexist --list &&
965+
test_must_fail git config --file=doesnotexist test.xyzzy
966966
'
967967

968968
test_expect_success SYMLINKS 'symlink to nonexistent configuration' '
969969
ln -s doesnotexist linktonada &&
970970
ln -s linktonada linktolinktonada &&
971-
test_must_fail env GIT_CONFIG=linktonada git config --list &&
972-
test_must_fail env GIT_CONFIG=linktolinktonada git config --list
971+
test_must_fail git config --file=linktonada --list &&
972+
test_must_fail git config --file=linktolinktonada --list
973973
'
974974

975975
test_expect_success 'check split_cmdline return' "

0 commit comments

Comments
 (0)