deal with .git pointer file in Git.CurrentRepo
This fixes the bug. Note, it's only done when GIT_DIR is set. When it's not set, Git.Construct already handled it. This is why it was only noticed with this git submodule command. This commit was sponsored by Brett Eisenberg on Patreon.
This commit is contained in:
parent
893d7b21e8
commit
681313dfd4
5 changed files with 38 additions and 24 deletions
|
@ -67,15 +67,14 @@ get = do
|
|||
configure (Just d) _ = do
|
||||
absd <- absPath d
|
||||
curr <- getCurrentDirectory
|
||||
r <- Git.Config.read $ newFrom $
|
||||
Local
|
||||
{ gitdir = toRawFilePath absd
|
||||
, worktree = Just (toRawFilePath curr)
|
||||
}
|
||||
loc <- adjustGitDirFile $ Local
|
||||
{ gitdir = toRawFilePath absd
|
||||
, worktree = Just (toRawFilePath curr)
|
||||
}
|
||||
r <- Git.Config.read $ newFrom loc
|
||||
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