Override safe.bareRepository for git remotes
Fix using git remotes that are bare when git is configured with safe.bareRepository = explicit Sponsored-by: Dartmouth College's DANDI project
This commit is contained in:
parent
cbfd214993
commit
baf8e4f6ed
7 changed files with 37 additions and 19 deletions
|
@ -72,18 +72,21 @@ read' repo = go repo
|
|||
go _ = assertLocal repo $ error "internal"
|
||||
git_config addparams d = withCreateProcess p (git_config' p)
|
||||
where
|
||||
params = addparams ++ safedirparam
|
||||
params = addparams ++ explicitrepoparams
|
||||
++ ["config", "--null", "--list"]
|
||||
p = (proc "git" params)
|
||||
{ cwd = Just (fromRawFilePath d)
|
||||
, env = gitEnv repo
|
||||
, std_out = CreatePipe
|
||||
}
|
||||
safedirparam = if safeDirectory repo
|
||||
-- Use * rather than d, because git treats
|
||||
-- "dir/" differently than "dir" when comparing for
|
||||
-- safe.directory purposes.
|
||||
then ["-c", "safe.directory=*"]
|
||||
explicitrepoparams = if repoPathSpecifiedExplicitly repo
|
||||
then
|
||||
-- Use * rather than d, because git treats
|
||||
-- "dir/" differently than "dir" when comparing
|
||||
-- for safe.directory purposes.
|
||||
[ "-c", "safe.directory=*"
|
||||
, "-c", "safe.bareRepository=all"
|
||||
]
|
||||
else []
|
||||
git_config' p _ (Just hout) _ pid =
|
||||
forceSuccessProcess p pid
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue