combine PendingAddChanges for the same file into one

In v6 unlocked mode, this fixes a problem that was making eg,
echo > file cause the assistant to copy the file to the annex object,
instead of hard linking it. That because 2 change events were seen
(one for opening the file and one for closing) and processed together
the file was then locked down twice. Which meant it had mutiple hard links,
and so prevented linkAnnex from hard linking it.

There might be scenarios where multiple events come in, but staggered such
that a file gets locked down repeatedly, and it would still be copied to
the annex object in that case.
This commit is contained in:
Joey Hess 2015-12-22 17:52:39 -04:00
parent d8a8c77a8f
commit c4152654d2
Failed to extract signature
2 changed files with 25 additions and 2 deletions

View file

@ -55,7 +55,8 @@ commitThread = namedThread "Committer" $ do
=<< annexDelayAdd <$> Annex.getGitConfig
msg <- liftAnnex Command.Sync.commitMsg
waitChangeTime $ \(changes, time) -> do
readychanges <- handleAdds havelsof delayadd changes
readychanges <- handleAdds havelsof delayadd $
simplifyChanges changes
if shouldCommit False time (length readychanges) readychanges
then do
debug