pass --git-dir when reading git config when it was specified explicitly
Let GIT_DIR and --git-dir override git's protection against operating in a repository owned by another user. This is the same behavior other git commands have. Sponsored-by: Jarkko Kniivilä on Patreon
This commit is contained in:
parent
1d47a7e7e6
commit
bfa451fc4e
3 changed files with 19 additions and 9 deletions
|
@ -79,11 +79,11 @@ get = do
|
|||
{ gitdir = absd
|
||||
, worktree = Just curr
|
||||
}
|
||||
r <- Git.Config.read $ newFrom loc
|
||||
let r' = r { gitDirSpecifiedExplicitly = True }
|
||||
return $ if Git.Config.isBare r'
|
||||
then r' { location = (location r) { worktree = Nothing } }
|
||||
else r'
|
||||
r <- Git.Config.read $ (newFrom loc)
|
||||
{ gitDirSpecifiedExplicitly = True }
|
||||
return $ if Git.Config.isBare r
|
||||
then r { location = (location r) { worktree = Nothing } }
|
||||
else r
|
||||
configure Nothing Nothing = giveup "Not in a git repository."
|
||||
|
||||
addworktree w r = changelocation r $ Local
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue