summaryrefslogtreecommitdiff
path: root/Annex
diff options
context:
space:
mode:
authorGravatar Joey Hess <joeyh@joeyh.name>2016-02-08 15:41:19 -0400
committerGravatar Joey Hess <joeyh@joeyh.name>2016-02-08 15:41:27 -0400
commitac0b50cc251eb683e67b1e8c1905fd6b3fe0df3f (patch)
tree50136af471aece0d869db86fe08811cbbf3df144 /Annex
parentcc18eb7e745bf980f62de261c9fbc8a08b96dd48 (diff)
init: Fix bugs in submodule .git symlink fixup, that occurred when initializing in a subdirectory of a submodule and a submodule of a submodule.
Diffstat (limited to 'Annex')
-rw-r--r--Annex/Fixup.hs3
1 files changed, 2 insertions, 1 deletions
diff --git a/Annex/Fixup.hs b/Annex/Fixup.hs
index 4d9afea91..1cde86390 100644
--- a/Annex/Fixup.hs
+++ b/Annex/Fixup.hs
@@ -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