Create new patch set references before database records
Ensure the commit used by a new change or replacement patch set always exists in the Git repository by writing the reference first as part of the overall BatchRefUpdate, then inserting the database records if all of the references stored successfully. This refactoring simplifies some of the logic involved, and lets some JGit backends that benefit from batching references see all updates at once, which may reduce the overall transaction time. Change-Id: Id5a4d8c3d7abd035accc9682714ac782924f0a33
This commit is contained in:
@@ -491,6 +491,10 @@ public final class Change {
|
||||
--nbrPatchSets;
|
||||
}
|
||||
|
||||
public void updateNumberOfPatchSets(int max) {
|
||||
nbrPatchSets = Math.max(nbrPatchSets, max);
|
||||
}
|
||||
|
||||
public PatchSet.Id currPatchSetId() {
|
||||
return new PatchSet.Id(changeId, nbrPatchSets);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user