hard links on windows

* annex.thin and annex.hardlink are now supported on Windows.
* unannex --fast now makes hard links on Windows.
This commit is contained in:
Joey Hess 2016-04-08 15:25:32 -04:00
parent 251405eca2
commit cf06dac2b8
Failed to extract signature
8 changed files with 29 additions and 26 deletions

View file

@ -5,8 +5,6 @@
- Licensed under the GNU GPL version 3 or higher.
-}
{-# LANGUAGE CPP #-}
module Command.Unannex where
import Command
@ -107,15 +105,11 @@ cleanupIndirect file key = do
copyfrom src =
thawContent file `after` liftIO (copyFileExternal CopyAllMetaData src file)
hardlinkfrom src =
#ifndef mingw32_HOST_OS
-- creating a hard link could fall; fall back to copying
ifM (liftIO $ catchBoolIO $ createLink src file >> return True)
( return True
, copyfrom src
)
#else
copyfrom src
#endif
performDirect :: FilePath -> Key -> CommandPerform
performDirect file key = do