summaryrefslogtreecommitdiff
path: root/Annex
diff options
context:
space:
mode:
authorGravatar Joey Hess <joeyh@joeyh.name>2015-03-04 16:08:41 -0400
committerGravatar Joey Hess <joeyh@joeyh.name>2015-03-04 16:08:41 -0400
commit2c911300c50040f17d314c5c0891c82ecab4bb88 (patch)
tree4a50dc665f1b9c37cc9ea364752b85c7953298aa /Annex
parent179af68964152d182caeea9fd6c75858e4cfd2af (diff)
fixup annex link target calculation when submodules are used in filesystems not supporting symlinks
Diffstat (limited to 'Annex')
-rw-r--r--Annex/Fixup.hs10
1 files changed, 8 insertions, 2 deletions
diff --git a/Annex/Fixup.hs b/Annex/Fixup.hs
index cda36461c..bb35454ee 100644
--- a/Annex/Fixup.hs
+++ b/Annex/Fixup.hs
@@ -60,12 +60,13 @@ fixupDirect r = return r
- submodule is mounted.
-
- When the filesystem doesn't support symlinks, we cannot make .git
- - into a symlink. In this case, we merely adjust the Repo so that
+ - into a symlink. But we don't need too, since the repo will use direct
+ - mode, In this case, we merely adjust the Repo so that
- symlinks to objects that get checked in will be in the right form.
-}
fixupSubmodule :: Repo -> GitConfig -> IO Repo
fixupSubmodule r@(Repo { location = l@(Local { worktree = Just w, gitdir = d }) }) c
- | (".git" </> "modules") `isInfixOf` d = do
+ | needsSubmoduleFixup r = do
when (coreSymlinks c) $
replacedotgit
`catchNonAsync` \_e -> hPutStrLn stderr
@@ -84,3 +85,8 @@ fixupSubmodule r@(Repo { location = l@(Local { worktree = Just w, gitdir = d })
maybe (error "unset core.worktree failed") (\_ -> return ())
=<< Git.Config.unset "core.worktree" r
fixupSubmodule r _ = return r
+
+needsSubmoduleFixup :: Repo -> Bool
+needsSubmoduleFixup (Repo { location = (Local { worktree = Just _, gitdir = d }) }) =
+ (".git" </> "modules") `isInfixOf` d
+needsSubmoduleFixup _ = False