Fix display of warning message when encountering a file that uses an unsupported backend.
This commit is contained in:
parent
d4a95faeb2
commit
6fd83851c1
3 changed files with 9 additions and 5 deletions
|
@ -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 ++
|
||||
|
|
|
@ -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
2
debian/changelog
vendored
|
@ -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
|
||||
|
||||
|
|
Loading…
Reference in a new issue