From 55b405a965bf6b61843c57aba63085942f381dc9 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Wed, 22 Sep 2021 10:41:39 -0400 Subject: [PATCH] fix remote git config vs global git config order Bug fix: Git configs such as annex.verify were incorrectly overriding per-remote git configs such as remote.name.annex-verify. This dates all the way back to 2013, commit 8a5b397ac47b21906f1fbb6254f5b70b3beb2a52, where hlint apparently somehow confused me into parsing in the wrong order. Before that it was correct. Amazing noone has noticed until now. Sponsored-by: Kevin Mueller on Patreon --- CHANGELOG | 3 +++ Types/GitConfig.hs | 6 ++++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index c1e6446bed..9589632065 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,5 +1,8 @@ git-annex (8.20210904) UNRELEASED; urgency=medium + * Bug fix: Git configs such as annex.verify were incorrectly overriding + per-remote git configs such as remote.name.annex-verify. + (Reversion in version 4.20130323) * borg: Avoid trying to extract xattrs, ACLS, and bsdflags when retrieving from a borg repository. * Resume where it left off when copying a file to/from a local git remote diff --git a/Types/GitConfig.hs b/Types/GitConfig.hs index ab1060e060..5cdde68f37 100644 --- a/Types/GitConfig.hs +++ b/Types/GitConfig.hs @@ -440,8 +440,10 @@ extractRemoteGitConfig r remotename = do getmaybebool k = Git.Config.isTrueFalse' =<< getmaybe' k getmayberead k = readish =<< getmaybe k getmaybe = fmap fromConfigValue . getmaybe' - getmaybe' k = mplus (Git.Config.getMaybe (annexConfig k) r) - (Git.Config.getMaybe (remoteAnnexConfig remotename k) r) + getmaybe' k = + Git.Config.getMaybe (remoteAnnexConfig remotename k) r + <|> + Git.Config.getMaybe (annexConfig k) r getoptions k = fromMaybe [] $ words <$> getmaybe k notempty :: Maybe String -> Maybe String