Correct RebaseChangeOp running hooks

Hooks were not properly invoked for RebaseChangeOp, since it would
simply fall back to the parent class and not call the
PatchSetInserter's method to ensure hooks are run.

Change-Id: I3c70c5e46f84891d79a80630e191288bf7e68e52
This commit is contained in:
Doug Kelly
2015-11-12 17:35:11 -08:00
parent e7eeacbf9e
commit 864355d71e

View File

@@ -25,6 +25,7 @@ import com.google.gerrit.reviewdb.client.RevId;
import com.google.gerrit.server.ChangeUtil;
import com.google.gerrit.server.git.BatchUpdate;
import com.google.gerrit.server.git.BatchUpdate.ChangeContext;
import com.google.gerrit.server.git.BatchUpdate.Context;
import com.google.gerrit.server.git.BatchUpdate.RepoContext;
import com.google.gerrit.server.git.MergeUtil;
import com.google.gerrit.server.git.validators.CommitValidators;
@@ -148,6 +149,11 @@ public class RebaseChangeOp extends BatchUpdate.Op {
rebasedPatchSet = patchSetInserter.getPatchSet();
}
@Override
public void postUpdate(Context ctx) throws OrmException {
patchSetInserter.postUpdate(ctx);
}
public PatchSet getPatchSet() {
checkState(rebasedPatchSet != null,
"getPatchSet() only valid after executing update");