diff options
author | Joey Hess <joey@kitenet.net> | 2013-04-02 16:20:23 -0400 |
---|---|---|
committer | Joey Hess <joey@kitenet.net> | 2013-04-02 16:20:23 -0400 |
commit | 9b3b48943366e4af1a074da32c0fc27ec8f1156c (patch) | |
tree | f308d53e011e3558b9ae0de8aa5de8970bd66b18 /Assistant/Threads | |
parent | c150b05386e97ddaa1162a0943312223c94a225b (diff) |
convert "./file" from inotify to just "file"
This just prettifies some display.
Diffstat (limited to 'Assistant/Threads')
-rw-r--r-- | Assistant/Threads/Watcher.hs | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/Assistant/Threads/Watcher.hs b/Assistant/Threads/Watcher.hs index b20a8d4d7..17de03dbc 100644 --- a/Assistant/Threads/Watcher.hs +++ b/Assistant/Threads/Watcher.hs @@ -158,7 +158,7 @@ type Handler = FilePath -> Maybe FileStatus -> Assistant (Maybe Change) -} runHandler :: Handler -> FilePath -> Maybe FileStatus -> Assistant () runHandler handler file filestatus = void $ do - r <- tryIO <~> handler file filestatus + r <- tryIO <~> handler (normalize file) filestatus case r of Left e -> liftIO $ print e Right Nothing -> noop @@ -167,6 +167,10 @@ runHandler handler file filestatus = void $ do -- flushing the queue fast enough. liftAnnex $ Annex.Queue.flushWhenFull 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. -} add :: FileMatcher -> FilePath -> Assistant (Maybe Change) |