summaryrefslogtreecommitdiff
path: root/Annex
diff options
context:
space:
mode:
authorGravatar Joey Hess <joeyh@joeyh.name>2017-05-15 17:13:08 -0400
committerGravatar Joey Hess <joeyh@joeyh.name>2017-05-15 21:35:35 -0400
commitc88dfda7e03cab4d96417518b6cfcffd54ad8f5d (patch)
treee8b74b19ed21809af4c170bbf0100d213f2b1d78 /Annex
parentf1559c6cfee308e2a3c539bfb8fc8986ca610f61 (diff)
remove absNormPathUnix again
Moving toward dropping MissingH dep. I think I've addressed the problem identified earlier in 7141943075211f9dd4959ca4c8b0a274f48dc9ff. On Windows, absPathFrom "/tmp/repo/xxx" "y/bar" would be "/tmp/repo/xxx\\y/bar", which then confuses relPathDirToFile. Fixed by converting to unix (git) style paths. Also, relPathDirToFile was splitting only on \\ on windows and not / which broke the example in 7141943075211f9dd4959ca4c8b0a274f48dc9ff of relPathDirToFile (absPathFrom "/tmp/repo/xxx" "y/bar") "/tmp/repo/.git/annex/objects/xxx" Now, on windows, that will yield "..\\..\\..\\.git/annex/objects/xxx" which once converted to unix style paths is what we want.
Diffstat (limited to 'Annex')
-rw-r--r--Annex/Locations.hs8
1 files changed, 4 insertions, 4 deletions
diff --git a/Annex/Locations.hs b/Annex/Locations.hs
index 6bc24c4a8..494badcc6 100644
--- a/Annex/Locations.hs
+++ b/Annex/Locations.hs
@@ -172,7 +172,7 @@ gitAnnexLocation' key r config crippled symlinkssupported checker gitdir
gitAnnexLink :: FilePath -> Key -> Git.Repo -> GitConfig -> IO FilePath
gitAnnexLink file key r config = do
currdir <- getCurrentDirectory
- let absfile = fromMaybe whoops $ absNormPathUnix currdir file
+ let absfile = absNormPathUnix currdir file
let gitdir = getgitdir currdir
loc <- gitAnnexLocation' key r config False False (\_ -> return True) gitdir
toInternalGitPath <$> relPathDirToFile (parentDir absfile) loc
@@ -182,10 +182,10 @@ gitAnnexLink file key r config = do
- supporting symlinks; generate link target that will
- work portably. -}
| not (coreSymlinks config) && needsSubmoduleFixup r =
- fromMaybe whoops $ absNormPathUnix currdir $
- Git.repoPath r </> ".git"
+ absNormPathUnix currdir $ Git.repoPath r </> ".git"
| otherwise = Git.localGitDir r
- whoops = error $ "unable to normalize " ++ file
+ absNormPathUnix d p = toInternalGitPath $
+ absPathFrom (toInternalGitPath d) (toInternalGitPath p)
{- Calculates a symlink target as would be used in a typical git
- repository, with .git in the top of the work tree. -}