rename changeGitConfig to overrideGitConfig and avoid unncessary calls
It's important that it be clear that it overrides a config, such that reloading the git config won't change it, and in particular, setConfig won't change it. Most of the calls to changeGitConfig were actually after setConfig, which was redundant and unncessary. So removed those. The only remaining one, besides --debug, is in the handling of repository-global config values. That one's ok, because the way mergeGitConfig is implemented, it does not override any value that is set in git config. If a value with a repo-global setting was passed to setConfig, it would set it in the git config, reload the git config, re-apply mergeGitConfig, and use the newly set value, which is the right thing.
This commit is contained in:
parent
c089f395b0
commit
c78b9b55b6
7 changed files with 9 additions and 16 deletions
|
@ -35,6 +35,6 @@ getGitConfigVal' f = (f <$> Annex.getGitConfig) >>= \case
|
|||
-- config makes all repository-global default
|
||||
-- values populate the GitConfig with HasGlobalConfig
|
||||
-- values, so it will only need to be done once.
|
||||
Annex.changeGitConfig (\gc -> mergeGitConfig gc globalgc)
|
||||
Annex.overrideGitConfig (\gc -> mergeGitConfig gc globalgc)
|
||||
f <$> Annex.getGitConfig
|
||||
c -> return c
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue