Merge "ReceiveCommits: Don't instantiate BranchCommitValidator repeatedly" into stable-2.16

This commit is contained in:
David Pursehouse
2019-06-27 08:16:07 +00:00
committed by Gerrit Code Review

View File

@@ -3033,6 +3033,7 @@ class ReceiveCommits {
}
}
BranchCommitValidator validator = commitValidatorFactory.create(projectState, branch, user);
RevWalk walk = receivePack.getRevWalk();
walk.reset();
walk.sort(RevSort.NONE);
@@ -3059,7 +3060,6 @@ class ReceiveCommits {
continue;
}
BranchCommitValidator validator = commitValidatorFactory.create(projectState, branch, user);
if (!validator.validCommit(
walk.getObjectReader(), cmd, c, false, messages, rejectCommits, null, skipValidation)) {
break;