summaryrefslogtreecommitdiff
path: root/GitAnnex
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2013-11-05 13:38:37 -0400
committerGravatar Joey Hess <joey@kitenet.net>2013-11-05 13:38:37 -0400
commite96c613c026c2d0bd6cce7210b058533d3ce972c (patch)
treea44c598f4b1047593f4c856fdd26e9ac8400556d /GitAnnex
parent70db4ebffa5a66ac97791d6780cb203ad6ac642f (diff)
pass -c option on to all git commands run
The -c option now not only modifies the git configuration seen by git-annex, but it is passed along to every git command git-annex runs. This was easy to plumb through because gitCommandLine is already used to construct every git command line, to add --git-dir and --work-tree
Diffstat (limited to 'GitAnnex')
-rw-r--r--GitAnnex/Options.hs7
1 files changed, 5 insertions, 2 deletions
diff --git a/GitAnnex/Options.hs b/GitAnnex/Options.hs
index 7f4cb60c2..88fad948a 100644
--- a/GitAnnex/Options.hs
+++ b/GitAnnex/Options.hs
@@ -11,6 +11,7 @@ import System.Console.GetOpt
import Common.Annex
import qualified Git.Config
+import Git.Types
import Command
import Types.TrustLevel
import qualified Annex
@@ -59,12 +60,14 @@ options = Option.common ++
"Trust Amazon Glacier inventory"
] ++ Option.matcher
where
+ trustArg t = ReqArg (Remote.forceTrust t) paramRemote
setnumcopies v = maybe noop
(\n -> Annex.changeState $ \s -> s { Annex.forcenumcopies = Just n })
(readish v)
setuseragent v = Annex.changeState $ \s -> s { Annex.useragent = Just v }
- setgitconfig v = Annex.changeGitRepo =<< inRepo (Git.Config.store v)
- trustArg t = ReqArg (Remote.forceTrust t) paramRemote
+ setgitconfig v = inRepo (Git.Config.store v)
+ >>= pure . (\r -> r { gitGlobalOpts = gitGlobalOpts r ++ [Param "-c", Param v] })
+ >>= Annex.changeGitRepo
keyOptions :: [Option]
keyOptions =