summaryrefslogtreecommitdiff
path: root/Utility
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2012-06-12 14:50:54 -0400
committerGravatar Joey Hess <joey@kitenet.net>2012-06-12 15:57:24 -0400
commit7d2c8133967d2f12cd18cf8f57e91a107e17bedb (patch)
tree14212326bc87d8f88dc4cc953e54dc36e3ae6781 /Utility
parent535d9e49984daa7669f8bbc6e83ef2f7989c21c9 (diff)
fix bug that turned files already in git into symlinks
This requires a relatively expensive test at file add time to see if it's in git already. But it can be optimised to only happen during the startup scan.
Diffstat (limited to 'Utility')
-rw-r--r--Utility/Inotify.hs2
1 files changed, 2 insertions, 0 deletions
diff --git a/Utility/Inotify.hs b/Utility/Inotify.hs
index ad0c21b22..5ed016c44 100644
--- a/Utility/Inotify.hs
+++ b/Utility/Inotify.hs
@@ -64,6 +64,8 @@ watchDir :: INotify -> FilePath -> (FilePath -> Bool) -> WatchHooks -> IO ()
watchDir i dir ignored hooks
| ignored dir = noop
| otherwise = do
+ -- Use a lock to make sure events generated during initial
+ -- scan come before real inotify events.
lock <- newLock
let handler event = withLock lock (void $ go event)
void (addWatch i watchevents dir handler)