summaryrefslogtreecommitdiff
path: root/CmdLine/GitAnnex
diff options
context:
space:
mode:
authorJoey Hess <joeyh@joeyh.name>2016-01-22 13:47:41 -0400
committerJoey Hess <joeyh@joeyh.name>2016-01-22 13:47:41 -0400
commit99c646615ddac34058f148b487c7e79a03858608 (patch)
treec3e456863196720269217a52dfab9e873b4632fd /CmdLine/GitAnnex
parentee146018906346c78abfce8abe6cc7c165458d69 (diff)
Bug fix: Git config settings passed to git-annex -c did not always take effect.
When Config.setConfig runs, it throws away the old Repo and loads a new one. So, add an action to adjust the Repo so that -c settings will persist across that.
Diffstat (limited to 'CmdLine/GitAnnex')
-rw-r--r--CmdLine/GitAnnex/Options.hs5
1 files changed, 2 insertions, 3 deletions
diff --git a/CmdLine/GitAnnex/Options.hs b/CmdLine/GitAnnex/Options.hs
index 81d6434e07..0147c212c5 100644
--- a/CmdLine/GitAnnex/Options.hs
+++ b/CmdLine/GitAnnex/Options.hs
@@ -87,9 +87,8 @@ gitAnnexGlobalOptions = commonGlobalOptions ++
where
setnumcopies n = Annex.changeState $ \s -> s { Annex.forcenumcopies = Just $ NumCopies n }
setuseragent v = Annex.changeState $ \s -> s { Annex.useragent = Just v }
- setgitconfig v = inRepo (Git.Config.store v)
- >>= pure . (\r -> r { gitGlobalOpts = gitGlobalOpts r ++ [Param "-c", Param v] })
- >>= Annex.changeGitRepo
+ setgitconfig v = Annex.adjustGitRepo $ \r -> Git.Config.store v $
+ r { gitGlobalOpts = gitGlobalOpts r ++ [Param "-c", Param v] }
setdesktopnotify v = Annex.changeState $ \s -> s { Annex.desktopnotify = Annex.desktopnotify s <> v }
{- Parser that accepts all non-option params. -}