convert "./file" from inotify to just "file"

This just prettifies some display.
This commit is contained in:
Joey Hess 2013-04-02 16:20:23 -04:00
parent 69a80a9a4d
commit 6e7842475b

View file

@ -158,7 +158,7 @@ type Handler = FilePath -> Maybe FileStatus -> Assistant (Maybe Change)
-} -}
runHandler :: Handler -> FilePath -> Maybe FileStatus -> Assistant () runHandler :: Handler -> FilePath -> Maybe FileStatus -> Assistant ()
runHandler handler file filestatus = void $ do runHandler handler file filestatus = void $ do
r <- tryIO <~> handler file filestatus r <- tryIO <~> handler (normalize file) filestatus
case r of case r of
Left e -> liftIO $ print e Left e -> liftIO $ print e
Right Nothing -> noop Right Nothing -> noop
@ -167,6 +167,10 @@ runHandler handler file filestatus = void $ do
-- flushing the queue fast enough. -- flushing the queue fast enough.
liftAnnex $ Annex.Queue.flushWhenFull liftAnnex $ Annex.Queue.flushWhenFull
recordChange change recordChange change
where
normalize f
| "./" `isPrefixOf` file = drop 2 f
| otherwise = f
{- Small files are added to git as-is, while large ones go into the annex. -} {- Small files are added to git as-is, while large ones go into the annex. -}
add :: FileMatcher -> FilePath -> Assistant (Maybe Change) add :: FileMatcher -> FilePath -> Assistant (Maybe Change)