diff options
Diffstat (limited to 'Backend.hs')
-rw-r--r-- | Backend.hs | 14 |
1 files changed, 4 insertions, 10 deletions
diff --git a/Backend.hs b/Backend.hs index 922d0c2a7..28f83c7e0 100644 --- a/Backend.hs +++ b/Backend.hs @@ -26,7 +26,6 @@ import Annex.Link import Types.Key import Types.KeySource import qualified Types.Backend as B -import Config -- When adding a new backend, import it here and add it to the list. import qualified Backend.Hash @@ -81,22 +80,17 @@ genKey' (b:bs) source = do {- Looks up the key corresponding to an annexed file, - by examining what the file links to. - - - In direct mode, there is often no link on disk, in which case - - the symlink is looked up in git instead. However, a real link - - on disk still takes precedence over what was committed to git in direct - - mode. + - An unlocked file will not have a link on disk, so fall back to + - looking for a pointer to a key in git. -} lookupFile :: FilePath -> Annex (Maybe Key) lookupFile file = do mkey <- isAnnexLink file case mkey of Just key -> makeret key - Nothing -> ifM isDirect - ( maybe (return Nothing) makeret =<< catKeyFile file - , return Nothing - ) + Nothing -> maybe (return Nothing) makeret =<< catKeyFile file where - makeret k = return $ Just k + makeret = return . Just getBackend :: FilePath -> Key -> Annex (Maybe Backend) getBackend file k = let bname = keyBackendName k in |