aboutsummaryrefslogtreecommitdiff
path: root/Remote/Directory.hs
diff options
context:
space:
mode:
authorGravatar Joey Hess <joeyh@joeyh.name>2015-04-18 13:36:12 -0400
committerGravatar Joey Hess <joeyh@joeyh.name>2015-04-18 13:36:12 -0400
commit293903ba38209a1e574ab6a929872ac5c31dfaf4 (patch)
tree9c0d49fbb06ee2b656834ddd01c6edd8f3f5f7ec /Remote/Directory.hs
parente770543c1010526d98730112d58ed304ab4ea341 (diff)
Fix fsck --from a git remote in a local directory, and from a directory special remote. This was a reversion caused by the relative path changes in 5.20150113.
The directory special remote was not affected in its normal configuration, since annex-directory is an absolute path normally. But it could fail when a relative path was used. The git remote was affected even when an absolute path to it was used in .git/config, since git-annex now converts all such paths to relative.
Diffstat (limited to 'Remote/Directory.hs')
-rw-r--r--Remote/Directory.hs10
1 files changed, 7 insertions, 3 deletions
diff --git a/Remote/Directory.hs b/Remote/Directory.hs
index 2eeb79317..916013172 100644
--- a/Remote/Directory.hs
+++ b/Remote/Directory.hs
@@ -162,9 +162,13 @@ retrieveCheap _ (UnpaddedChunks _) _ _ = return False
retrieveCheap _ (LegacyChunks _) _ _ = return False
#ifndef mingw32_HOST_OS
retrieveCheap d NoChunks k f = liftIO $ catchBoolIO $ do
- file <- getLocation d k
- createSymbolicLink file f
- return True
+ file <- absPath =<< getLocation d k
+ ifM (doesFileExist file)
+ ( do
+ createSymbolicLink file f
+ return True
+ , return False
+ )
#else
retrieveCheap _ _ _ _ = return False
#endif