Fix display of warning message when encountering a file that uses an unsupported backend.

This commit is contained in:
Joey Hess 2012-05-31 21:03:24 -04:00
parent d4a95faeb2
commit 6fd83851c1
3 changed files with 9 additions and 5 deletions

View file

@ -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 ++

View file

@ -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.
-

2
debian/changelog vendored
View file

@ -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