fix build

This commit is contained in:
Joey Hess 2020-03-09 12:29:40 -04:00
parent 6eb52cf5f1
commit 01acb5212e
No known key found for this signature in database
GPG key ID: DB12DB0FF05F8F38
2 changed files with 8 additions and 9 deletions

View file

@ -88,17 +88,16 @@ makeHardLink file key = do
fixSymlink :: FilePath -> FilePath -> CommandPerform fixSymlink :: FilePath -> FilePath -> CommandPerform
fixSymlink file link = do fixSymlink file link = do
liftIO $ do
#if ! defined(mingw32_HOST_OS) #if ! defined(mingw32_HOST_OS)
-- preserve mtime of symlink -- preserve mtime of symlink
mtime <- catchMaybeIO $ modificationTimeHiRes mtime <- liftIO $ catchMaybeIO $ modificationTimeHiRes
<$> getSymbolicLinkStatus file <$> getSymbolicLinkStatus file
#endif #endif
createWorkTreeDirectory (parentDir file) createWorkTreeDirectory (parentDir file)
removeFile file liftIO $ removeFile file
createSymbolicLink link file liftIO $ createSymbolicLink link file
#if ! defined(mingw32_HOST_OS) #if ! defined(mingw32_HOST_OS)
maybe noop (\t -> touch file t False) mtime liftIO $ maybe noop (\t -> touch file t False) mtime
#endif #endif
next $ cleanupSymlink file next $ cleanupSymlink file

View file

@ -219,7 +219,7 @@ fixLink key file = do
go want have go want have
| want /= fromRawFilePath (fromInternalGitPath have) = do | want /= fromRawFilePath (fromInternalGitPath have) = do
showNote "fixing link" showNote "fixing link"
liftIO $ createWorkTreeDirectory (parentDir (fromRawFilePath file)) createWorkTreeDirectory (parentDir (fromRawFilePath file))
liftIO $ removeFile (fromRawFilePath file) liftIO $ removeFile (fromRawFilePath file)
addAnnexLink want file addAnnexLink want file
| otherwise = noop | otherwise = noop