AsyncReceiveCommits#onPreReceive: Early exit when commands already processed

Change-Id: Ife5fecba72713ad7c5ab7847ff9a613d1602f474
Helped-by: David Ostrovsky <david@ostrovsky.org>
This commit is contained in:
David Pursehouse 2018-09-27 14:28:58 +09:00
parent 2919b01659
commit ba8186d5dc
1 changed files with 5 additions and 0 deletions

View File

@ -256,6 +256,11 @@ public class AsyncReceiveCommits implements PreReceiveHook {
@Override
public void onPreReceive(ReceivePack rp, Collection<ReceiveCommand> commands) {
if (commands.stream().anyMatch(c -> c.getResult() != Result.NOT_ATTEMPTED)) {
// Stop processing when command was already processed by previously invoked
// pre-receive hooks
return;
}
Worker w = new Worker(commands);
try {
w.progress.waitFor(