From: Joey Hess Date: Thu, 19 Nov 2020 16:20:18 +0000 (-0400) Subject: fix removeLink on windows X-Git-Tag: archive/raspbian/10.20250416-2+rpi1~2^2^2~80^2~46 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=9cb250f7be21a8f5b15454df4fb67bfd1811e39d;p=git-annex.git fix removeLink on windows This removeLink was introduced in commit e505c03bccdc6567cd517a6ddaf70a411489473d, which replaced code that used removeFile on Windows. So, I know git-annex did not used to do anything other than removeFile on Windows. If there were symlinks it wanted to remove, this would not work on windows, but of course it does not use symlinks on windows. --- diff --git a/Utility/RawFilePath.hs b/Utility/RawFilePath.hs index 362ae70cd1..c114fd9d3d 100644 --- a/Utility/RawFilePath.hs +++ b/Utility/RawFilePath.hs @@ -66,8 +66,10 @@ createLink a b = P.createLink (fromRawFilePath a) (fromRawFilePath b) +{- On windows, removeLink is not available, so only remove files, + - not symbolic links. -} removeLink :: RawFilePath -> IO () -removeLink = P.removeLink . fromRawFilePath +removeLink = D.removeFile . fromRawFilePath getFileStatus :: RawFilePath -> IO FileStatus getFileStatus = P.getFileStatus . fromRawFilePath