From 6fd83851c13232b7810a33e8bb1d83e8a46bd354 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Thu, 31 May 2012 21:03:24 -0400 Subject: Fix display of warning message when encountering a file that uses an unsupported backend. --- Backend.hs | 8 ++++---- Locations.hs | 4 +++- debian/changelog | 2 ++ 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/Backend.hs b/Backend.hs index 8071b9b83..fa3266944 100644 --- a/Backend.hs +++ b/Backend.hs @@ -75,16 +75,16 @@ genKey' (b:bs) file = do - by examining what the file symlinks to. -} lookupFile :: FilePath -> Annex (Maybe (Key, Backend)) lookupFile file = do - tl <- liftIO $ tryIO getsymlink + tl <- liftIO $ tryIO $ readSymbolicLink file case tl of Left _ -> return Nothing Right l -> makekey l where - getsymlink = takeFileName <$> readSymbolicLink file - makekey l = maybe (return Nothing) (makeret l) (fileKey l) + makekey l = maybe (return Nothing) (makeret l) (fileKey $ takeFileName l) makeret l k = let bname = keyBackendName k in case maybeLookupBackendName bname of - Just backend -> return $ Just (k, backend) + Just backend -> do + return $ Just (k, backend) Nothing -> do when (isLinkToAnnex l) $ warning $ "skipping " ++ file ++ diff --git a/Locations.hs b/Locations.hs index 46a85e0ee..db456388a 100644 --- a/Locations.hs +++ b/Locations.hs @@ -155,7 +155,9 @@ gitAnnexRemotesDir r = addTrailingPathSeparator $ gitAnnexDir r "remotes" {- Checks a symlink target to see if it appears to point to annexed content. -} isLinkToAnnex :: FilePath -> Bool -isLinkToAnnex s = ("/.git/" ++ objectDir) `isInfixOf` s +isLinkToAnnex s = ("/" ++ d) `isInfixOf` s || d `isPrefixOf` s + where + d = ".git" objectDir {- Converts a key into a filename fragment without any directory. - diff --git a/debian/changelog b/debian/changelog index a110e94ce..61290b1aa 100644 --- a/debian/changelog +++ b/debian/changelog @@ -4,6 +4,8 @@ git-annex (3.20120523) UNRELEASED; urgency=low * lock: Reset unlocked file to index, rather than to branch head. * import: New subcommand, pulls files from a directory outside the annex and adds them. + * Fix display of warning message when encountering a file that uses an + unsupported backend. -- Joey Hess Sun, 27 May 2012 20:55:29 -0400 -- cgit v1.2.3