init: Fix bugs in submodule .git symlink fixup, that occurred when initializing in a subdirectory of a submodule and a submodule of a submodule.
This commit is contained in:
parent
085ec7d693
commit
17c97434f2
4 changed files with 15 additions and 1 deletions
|
@ -90,8 +90,9 @@ fixupSubmodule r@(Repo { location = l@(Local { worktree = Just w, gitdir = d })
|
|||
where
|
||||
dotgit = w </> ".git"
|
||||
replacedotgit = whenM (doesFileExist dotgit) $ do
|
||||
linktarget <- relPathDirToFile w d
|
||||
nukeFile dotgit
|
||||
createSymbolicLink (w </> d) dotgit
|
||||
createSymbolicLink linktarget dotgit
|
||||
maybe (error "unset core.worktree failed") (\_ -> return ())
|
||||
=<< Git.Config.unset "core.worktree" r
|
||||
fixupSubmodule r _ = return r
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue