Source:
<code><START> protected void updateBranch() throws MergeException { <END> if (mergeTip != null && (branchTip == null || branchTip != mergeTip)) { if (GitRepositoryManager.REF_CONFIG.equals(branchUpdate.getName())) { try { ProjectConfig cfg = new ProjectConfig(destProject.getNameKey()); cfg.load(db, mergeTip); } catch (Exception e) { throw new MergeException("Submit would store invalid" + " project configuration " + mergeTip.name() + " for " + destProject.getName(), e); } } branchUpdate.setForceUpdate(false); branchUpdate.setNewObjectId(mergeTip); branchUpdate.setRefLogMessage("merged", true); try { switch (branchUpdate.update(rw)) { case NEW: case FAST_FORWARD: if (branchUpdate.getResult() == RefUpdate.Result.FAST_FORWARD) { mArguments.tagCache.updateFastForward(destBranch.getParentKey(), branchUpdate.getName(), branchUpdate.getOldObjectId(), mergeTip); } if (GitRepositoryManager.REF_CONFIG.equals(branchUpdate.getName())) { mArguments.projectCache.evict(destProject); ProjectState ps = mArguments.projectCache.get(destProject .getNameKey()); mArguments.repoManager.setProjectDescription( destProject.getNameKey(), ps.getProject().getDescription()); } mArguments.replication.scheduleUpdate(destBranch .getParentKey(), branchUpdate.getName()); Account account = null; final PatchSetApproval submitter = getSubmitter(mergeTip.patchsetId); if (submitter != null) { account = mArguments.accountCache.get(submitter.getAccountId()) .getAccount(); } mArguments.hooks.doRefUpdatedHook(destBranch, branchUpdate, account); break; default: throw new IOException(branchUpdate.getResult().name()); } } catch (IOException e) { throw new MergeException("Cannot update " + branchUpdate.getName(), e); } } }</code><technical_language>subclasses allowed override this method</technical_language>

Target:
protected final void updateBranch() throws MergeException { if (mergeTip != null && (branchTip == null || branchTip != mergeTip)) { if (GitRepositoryManager.REF_CONFIG.equals(branchUpdate.getName())) { try { ProjectConfig cfg = new ProjectConfig(destProject.getNameKey()); cfg.load(db, mergeTip); } catch (Exception e) { throw new MergeException("Submit would store invalid" + " project configuration " + mergeTip.name() + " for " + destProject.getName(), e); } } branchUpdate.setForceUpdate(false); branchUpdate.setNewObjectId(mergeTip); branchUpdate.setRefLogMessage("merged", true); try { switch (branchUpdate.update(rw)) { case NEW: case FAST_FORWARD: if (branchUpdate.getResult() == RefUpdate.Result.FAST_FORWARD) { mArguments.tagCache.updateFastForward(destBranch.getParentKey(), branchUpdate.getName(), branchUpdate.getOldObjectId(), mergeTip); } if (GitRepositoryManager.REF_CONFIG.equals(branchUpdate.getName())) { mArguments.projectCache.evict(destProject); ProjectState ps = mArguments.projectCache.get(destProject .getNameKey()); mArguments.repoManager.setProjectDescription( destProject.getNameKey(), ps.getProject().getDescription()); } mArguments.replication.scheduleUpdate(destBranch .getParentKey(), branchUpdate.getName()); Account account = null; final PatchSetApproval submitter = getSubmitter(mergeTip.patchsetId); if (submitter != null) { account = mArguments.accountCache.get(submitter.getAccountId()) .getAccount(); } mArguments.hooks.doRefUpdatedHook(destBranch, branchUpdate, account); break; default: throw new IOException(branchUpdate.getResult().name()); } } catch (IOException e) { throw new MergeException("Cannot update " + branchUpdate.getName(), e); } } }