use R.readSymbolicLink

This will be faster once gitAnnexLink is converted to a RawFilePath.
This commit is contained in:
Joey Hess 2019-12-06 14:19:23 -04:00
parent 360942ba12
commit 0e9d699ef3
No known key found for this signature in database
GPG key ID: DB12DB0FF05F8F38

View file

@ -17,6 +17,7 @@ import Annex.Content
import Annex.Perms
import qualified Annex.Queue
import qualified Database.Keys
import qualified Utility.RawFilePath as R
#if ! defined(mingw32_HOST_OS)
import Utility.Touch
@ -39,11 +40,11 @@ data FixWhat = FixSymlinks | FixAll
start :: FixWhat -> RawFilePath -> Key -> CommandStart
start fixwhat file key = do
currlink <- liftIO $ catchMaybeIO $ readSymbolicLink $ fromRawFilePath file
currlink <- liftIO $ catchMaybeIO $ R.readSymbolicLink file
wantlink <- calcRepo $ gitAnnexLink (fromRawFilePath file) key
case currlink of
Just l
| l /= wantlink -> fixby $
| l /= toRawFilePath wantlink -> fixby $
fixSymlink (fromRawFilePath file) wantlink
| otherwise -> stop
Nothing -> case fixwhat of