t: prefer "git config --file" to GIT_CONFIG with test_must_fail
authorJeff King <redacted>
Thu, 20 Mar 2014 23:15:54 +0000 (19:15 -0400)
committerJunio C Hamano <redacted>
Fri, 21 Mar 2014 21:26:22 +0000 (14:26 -0700)
This lets us get rid of an extra "env" invocation in the
middle, and is slightly more readable.

Signed-off-by: Jeff King <redacted>
Signed-off-by: Junio C Hamano <redacted>
t/t1300-repo-config.sh

index cd23d070291166d67f5b30adcba358e5958c80a5..e355aa1c97f48b2256d1b05b8c539a0b78199f02 100755 (executable)
@@ -961,15 +961,15 @@ test_expect_success SYMLINKS 'symlinked configuration' '
 '
 
 test_expect_success 'nonexistent configuration' '
-       test_must_fail env GIT_CONFIG=doesnotexist git config --list &&
-       test_must_fail env GIT_CONFIG=doesnotexist git config test.xyzzy
+       test_must_fail git config --file=doesnotexist --list &&
+       test_must_fail git config --file=doesnotexist test.xyzzy
 '
 
 test_expect_success SYMLINKS 'symlink to nonexistent configuration' '
        ln -s doesnotexist linktonada &&
        ln -s linktonada linktolinktonada &&
-       test_must_fail env GIT_CONFIG=linktonada git config --list &&
-       test_must_fail env GIT_CONFIG=linktolinktonada git config --list
+       test_must_fail git config --file=linktonada --list &&
+       test_must_fail git config --file=linktolinktonada --list
 '
 
 test_expect_success 'check split_cmdline return' "
git clone https://git.99rst.org/PROJECT