Add missing call to ref-updated hook for submodule updates
Add call to ref-updated hook when a project ref is updated because of submodule subscription. Bug: issue 2831 Change-Id: I176ea044fe4bbb2d5abc596b3da6dcd0a8d3e12f
This commit is contained in:

committed by
David Pursehouse

parent
4745a16a8b
commit
038b642cbe
@@ -648,14 +648,17 @@ public class MergeOp {
|
||||
|
||||
private void fireRefUpdated(RefUpdate branchUpdate) {
|
||||
gitRefUpdated.fire(destBranch.getParentKey(), branchUpdate);
|
||||
hooks.doRefUpdatedHook(destBranch, branchUpdate, getAccount(mergeTip));
|
||||
}
|
||||
|
||||
private Account getAccount(CodeReviewCommit codeReviewCommit) {
|
||||
Account account = null;
|
||||
PatchSetApproval submitter = approvalsUtil.getSubmitter(
|
||||
db, mergeTip.notes(), mergeTip.getPatchsetId());
|
||||
db, codeReviewCommit.notes(), codeReviewCommit.getPatchsetId());
|
||||
if (submitter != null) {
|
||||
account = accountCache.get(submitter.getAccountId()).getAccount();
|
||||
}
|
||||
hooks.doRefUpdatedHook(destBranch, branchUpdate, account);
|
||||
return account;
|
||||
}
|
||||
|
||||
private void updateChangeStatus(final List<Change> submitted) {
|
||||
@@ -719,7 +722,8 @@ public class MergeOp {
|
||||
if (mergeTip != null && (branchTip == null || branchTip != mergeTip)) {
|
||||
SubmoduleOp subOp =
|
||||
subOpFactory.create(destBranch, mergeTip, rw, repo,
|
||||
destProject.getProject(), submitted, commits);
|
||||
destProject.getProject(), submitted, commits,
|
||||
getAccount(mergeTip));
|
||||
try {
|
||||
subOp.update();
|
||||
} catch (SubmoduleException e) {
|
||||
|
Reference in New Issue
Block a user