summaryrefslogtreecommitdiff
path: root/Locations.hs
diff options
context:
space:
mode:
authorGravatar Joey Hess <joeyh@joeyh.name>2015-01-21 13:54:47 -0400
committerGravatar Joey Hess <joeyh@joeyh.name>2015-01-21 13:54:47 -0400
commit7141943075211f9dd4959ca4c8b0a274f48dc9ff (patch)
treeebe584d015ca256071bcccb8de0f46aebe8ba67d /Locations.hs
parent961b5d4d997999485e7b696416574cd0f8663f88 (diff)
Revert "remove absNormPathUnix, using my absPathFrom replacement"
This reverts commit b6b368ed036f2e34ee4b7d39e5b41b1ba2d0a76c. Consider: relPathDirToFile (absPathFrom "/tmp/repo/xxx" "y/bar") "/tmp/repo/.git/annex/objects/xxx" This needs to always yield "../../../.git/annex/objects/xxx" but on Windows, it is "..\\..\\/tmp/repo/.git/annex/objects/xxx"
Diffstat (limited to 'Locations.hs')
-rw-r--r--Locations.hs4
1 files changed, 3 insertions, 1 deletions
diff --git a/Locations.hs b/Locations.hs
index 82c324e2c..596bf4f85 100644
--- a/Locations.hs
+++ b/Locations.hs
@@ -144,9 +144,11 @@ gitAnnexLocation' key r crippled
gitAnnexLink :: FilePath -> Key -> Git.Repo -> IO FilePath
gitAnnexLink file key r = do
currdir <- getCurrentDirectory
- let absfile = absPathFrom currdir file
+ let absfile = fromMaybe whoops $ absNormPathUnix currdir file
loc <- gitAnnexLocation' key r False
relPathDirToFile (parentDir absfile) loc
+ where
+ whoops = error $ "unable to normalize " ++ file
{- File used to lock a key's content. -}
gitAnnexContentLock :: Key -> Git.Repo -> GitConfig -> IO FilePath