mirror of
https://github.com/git/git.git
synced 2026-04-11 17:30:08 +02:00
config: always parse GIT_CONFIG_PARAMETERS during git_config
Previously we parsed GIT_CONFIG_PARAMETERS lazily into a linked list, and then checked that list during future invocations of git_config. However, that ignores the fact that the environment variable could change during our run (e.g., because we parse more "-c" as part of an alias). Instead, let's just re-parse the environment variable each time. It's generally not very big, and it's no more work than parsing the config files, anyway. As a bonus, we can ditch all of the linked list storage code entirely, making the code much simpler. The test unfortunately still does not pass because of an unrelated bug in handle_options. 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
5a0c9eeb89
commit
06eb708f33
@@ -854,4 +854,11 @@ test_expect_success 'git -c "key=value" support' '
|
||||
test_must_fail git -c core.name=value config name
|
||||
'
|
||||
|
||||
test_expect_failure 'git -c works with aliases of builtins' '
|
||||
git config alias.checkconfig "-c foo.check=bar config foo.check" &&
|
||||
echo bar >expect &&
|
||||
git checkconfig >actual &&
|
||||
test_cmp expect actual
|
||||
'
|
||||
|
||||
test_done
|
||||
|
||||
Reference in New Issue
Block a user