(replacedotgit >> unsetcoreworktree)
`catchNonAsync` \e -> hPutStrLn stderr $
"warning: unable to convert submodule to form that will work with git-annex: " ++ show e
- return $ r'
+ return $ r
{ config = M.delete "core.worktree" (config r)
}
| otherwise = ifM (needsGitLinkFixup r)
(replacedotgit >> worktreefixup)
`catchNonAsync` \e -> hPutStrLn stderr $
"warning: unable to convert .git file to symlink that will work with git-annex: " ++ show e
- setworktreepath r'
- else setworktreepath r'
+ setworktreepath r
+ else setworktreepath r
, return r
)
where
fmap toOsPath . headMaybe . lines
<$> readFile commondirfile
- setworktreepath r'' = readcommondirfile >>= \case
- Just gd -> return $ r''
+ setworktreepath r' = readcommondirfile >>= \case
+ Just gd -> return $ r'
{ mainWorkTreePath = Just gd
}
- Nothing -> return r''
+ Nothing -> return r'
worktreefixup = readcommondirfile >>= \case
Just gd -> do
R.createSymbolicLink (fromOsPath linktarget) $
fromOsPath $ dotgit </> literalOsPath "annex"
Nothing -> return ()
-
- -- Repo adjusted, so that symlinks to objects that get checked
- -- in will have the usual path, rather than pointing off to the
- -- real .git directory.
- r'
- | coreSymlinks c = r { location = l { gitdir = dotgit } }
- | otherwise = r
fixupUnusualRepos r _ = return r
needsSubmoduleFixup :: Repo -> Bool