summaryrefslogtreecommitdiff
path: root/Annex.hs
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2013-11-05 15:31:37 -0400
committerGravatar Joey Hess <joey@kitenet.net>2013-11-05 15:41:24 -0400
commitda9eea5dc0e86b4abb14064346eddc5689d94333 (patch)
tree6da412083ff594f3fa2abbe2d0b8b450346e77dd /Annex.hs
parent8bb9d23f521582e51ceaee03d1aa5084cad3de08 (diff)
automatically set and unset core.bare when switching to/from direct mode
Diffstat (limited to 'Annex.hs')
-rw-r--r--Annex.hs13
1 files changed, 9 insertions, 4 deletions
diff --git a/Annex.hs b/Annex.hs
index 1fde4cd42..b634041db 100644
--- a/Annex.hs
+++ b/Annex.hs
@@ -45,6 +45,7 @@ import Git.CatFile
import Git.CheckAttr
import Git.CheckIgnore
import Git.SharedRepository
+import Git.Config
import qualified Git.Queue
import Types.Backend
import Types.GitConfig
@@ -254,8 +255,12 @@ withCurrentState a = do
- Fix up the Repo to be a non-bare repo, and arrange for git commands
- run by git-annex to be passed parameters that override this setting. -}
fixupDirect :: Git.Repo -> Git.Repo
-fixupDirect r@(Repo { location = Local { gitdir = d, worktree = Nothing } }) = r
- { location = Local { gitdir = d </> ".git", worktree = Just d }
- , gitGlobalOpts = gitGlobalOpts r ++ [Param "-c", Param "core.bare=false"]
- }
+fixupDirect r@(Repo { location = Local { gitdir = d, worktree = Nothing } }) =
+ r
+ { location = Local { gitdir = d </> ".git", worktree = Just d }
+ , gitGlobalOpts = gitGlobalOpts r ++
+ [ Param "-c"
+ , Param $ coreBare ++ "=" ++ boolConfig False
+ ]
+ }
fixupDirect r = r