automatically set and unset core.bare when switching to/from direct mode
This commit is contained in:
parent
0edd9ec03a
commit
04768e44b2
4 changed files with 18 additions and 7 deletions
13
Annex.hs
13
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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue