diff options
author | 2012-05-31 21:03:24 -0400 | |
---|---|---|
committer | 2012-05-31 21:03:24 -0400 | |
commit | 6fd83851c13232b7810a33e8bb1d83e8a46bd354 (patch) | |
tree | 6144bcf207fd3867c54a4bcde35fe82bcc912c95 | |
parent | d4a95faeb2786027e13cc3f49825a6b4ad231768 (diff) |
Fix display of warning message when encountering a file that uses an unsupported backend.
-rw-r--r-- | Backend.hs | 8 | ||||
-rw-r--r-- | Locations.hs | 4 | ||||
-rw-r--r-- | 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 <joeyh@debian.org> Sun, 27 May 2012 20:55:29 -0400 |