summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Assistant/Committer.hs19
1 files changed, 4 insertions, 15 deletions
diff --git a/Assistant/Committer.hs b/Assistant/Committer.hs
index 64ea300e2..71152e5e9 100644
--- a/Assistant/Committer.hs
+++ b/Assistant/Committer.hs
@@ -84,23 +84,20 @@ commitThread st changechan = runEvery (Seconds 1) $ do
- for write by some other process.
-
- When a file is added, Inotify will notice the new symlink. So this waits
- - for one new LinkChange to be received per file that's successfully
- - added, to ensure that its symlink has been staged before returning.
+ - for additional Changes to arrive, so that the symlink has hopefully been
+ - staged before returning.
-}
handleAdds :: ThreadState -> ChangeChan -> [Change] -> IO ()
handleAdds st changechan cs
| null added = noop
| otherwise = do
- r <- forM added $ catchBoolIO . runThreadState st . add
- let numadded = length $ filter id r
- handleAdds st changechan =<< waitforlinkchanges [] numadded
+ forM_ added $ catchBoolIO . runThreadState st . add
+ handleAdds st changechan =<< getChanges changechan
where
added = map changeFile $ filter isPendingAdd cs
isPendingAdd (Change { changeType = PendingAddChange }) = True
isPendingAdd _ = False
- isLinkChange (Change { changeType = LinkChange }) = True
- isLinkChange _ = False
add file = do
showStart "add" file
@@ -114,14 +111,6 @@ handleAdds st changechan cs
showEndOk
return True
- waitforlinkchanges c n
- | n < 1 = return $ concat c
- | otherwise = do
- (done, rest) <- partition isLinkChange
- <$> getChanges changechan
- let n' = (n - length done)
- waitforlinkchanges (rest:c) n'
-
commitStaged :: Annex ()
commitStaged = do
Annex.Queue.flush