t: prefer "git config --file" to GIT_CONFIG
Doing: GIT_CONFIG=foo git config ... is equivalent to: git config --file=foo ... The latter is easier to read and slightly less error-prone, because of issues with one-shot variables and shell functions (e.g., you cannot use the former with test_must_fail). Note that we explicitly leave one case in t1300 which checks the same operation on both GIT_CONFIG and "git config --file". They are equivalent in the code these days, but this will make sure it remains so. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:

committed by
Junio C Hamano

parent
551a3e60d1
commit
f7e8714101
@ -67,7 +67,7 @@ test_expect_success 'fetch fails on ee' '
|
||||
'
|
||||
|
||||
tmp_config_get () {
|
||||
GIT_CONFIG=.git/svn/.metadata git config --get "$1"
|
||||
git config --file=.git/svn/.metadata --get "$1"
|
||||
}
|
||||
|
||||
test_expect_success 'failure happened without negative side effects' '
|
||||
|
Reference in New Issue
Block a user