From 9cb250f7be21a8f5b15454df4fb67bfd1811e39d Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Thu, 19 Nov 2020 12:20:18 -0400 Subject: [PATCH] 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. --- Utility/RawFilePath.hs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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