kqueue bugfix: apply pruner to changed files
It already applied the pruner when traversing directories, so .git is excluded, but .gitignore was not. Now it is.
This commit is contained in:
parent
1363cea260
commit
364ae8317d
2 changed files with 4 additions and 3 deletions
|
@ -102,8 +102,8 @@ watchDir dir prune hooks runstartup = do
|
||||||
#if WITH_KQUEUE
|
#if WITH_KQUEUE
|
||||||
type DirWatcherHandle = ThreadId
|
type DirWatcherHandle = ThreadId
|
||||||
watchDir :: FilePath -> Pruner -> WatchHooks -> (IO Kqueue.Kqueue -> IO Kqueue.Kqueue) -> IO DirWatcherHandle
|
watchDir :: FilePath -> Pruner -> WatchHooks -> (IO Kqueue.Kqueue -> IO Kqueue.Kqueue) -> IO DirWatcherHandle
|
||||||
watchDir dir ignored hooks runstartup = do
|
watchDir dir prune hooks runstartup = do
|
||||||
kq <- runstartup $ Kqueue.initKqueue dir ignored
|
kq <- runstartup $ Kqueue.initKqueue dir prune
|
||||||
forkIO $ Kqueue.runHooks kq hooks
|
forkIO $ Kqueue.runHooks kq hooks
|
||||||
#else
|
#else
|
||||||
type DirWatcherHandle = ()
|
type DirWatcherHandle = ()
|
||||||
|
|
|
@ -198,7 +198,8 @@ handleChange kq@(Kqueue _ _ dirmap pruner) fd olddirinfo =
|
||||||
go =<< catchMaybeIO (getDirInfo $ dirName olddirinfo)
|
go =<< catchMaybeIO (getDirInfo $ dirName olddirinfo)
|
||||||
where
|
where
|
||||||
go (Just newdirinfo) = do
|
go (Just newdirinfo) = do
|
||||||
let changes = olddirinfo // newdirinfo
|
let changes = filter (not . pruner . changedFile) $
|
||||||
|
olddirinfo // newdirinfo
|
||||||
let (added, deleted) = partition isAdd changes
|
let (added, deleted) = partition isAdd changes
|
||||||
|
|
||||||
-- Scan newly added directories to add to the map.
|
-- Scan newly added directories to add to the map.
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue