AsyncReceiveCommits#onPreReceive: Early exit when commands already processed
Change-Id: Ife5fecba72713ad7c5ab7847ff9a613d1602f474 Helped-by: David Ostrovsky <david@ostrovsky.org>
This commit is contained in:
@@ -256,6 +256,11 @@ public class AsyncReceiveCommits implements PreReceiveHook {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onPreReceive(ReceivePack rp, Collection<ReceiveCommand> commands) {
|
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);
|
Worker w = new Worker(commands);
|
||||||
try {
|
try {
|
||||||
w.progress.waitFor(
|
w.progress.waitFor(
|
||||||
|
Reference in New Issue
Block a user