Source:
private RefUpdate updateBranch(final SubmitStrategy strategy, final RefUpdate branchUpdate) throws MergeException { if ((branchTip == null && mergeTip == null) || branchTip == mergeTip) { return null; } if (mergeTip != null && (branchTip == null || branchTip != mergeTip)) { if (RefNames.REFS_CONFIG.equals(branchUpdate.getName())) { try { ProjectConfig cfg = new ProjectConfig(destProject.getProject().getNameKey()); cfg.load(repo, mergeTip); } catch (Exception e) { throw new MergeException("Submit would store invalid" + " project configuration " + mergeTip.name() + " for " + destProject.getProject().getName(), e); } } branchUpdate.setRefLogIdent(refLogIdent); 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) { tagCache.updateFastForward(destBranch.getParentKey(), branchUpdate.getName(), branchUpdate.getOldObjectId(), mergeTip); } if (RefNames.REFS_CONFIG.equals(branchUpdate.getName())) { projectCache.evict(destProject.getProject()); destProject = projectCache.get(destProject.getProject().getNameKey()); repoManager.setProjectDescription( destProject.getProject().getNameKey(), destProject.getProject().getDescription()); } return branchUpdate; case LOCK_FAILURE: String msg; if (strategy.retryOnLockFailure()) { mergeQueue.recheckAfter(destBranch, LOCK_FAILURE_RETRY_DELAY, MILLISECONDS); msg = "will retry"; } else { msg = "will not retry"; } throw new IOException(branchUpdate.getResult().name() + ", " + msg); default: throw new IOException(branchUpdate.getResult().name()); } } catch (IOException e) { throw new MergeException("Cannot update " + branchUpdate.getName(), e); } } else { return null; } }

Target:
private RefUpdate updateBranch(final SubmitStrategy strategy, final RefUpdate branchUpdate) throws MergeException { if (branchTip == mergeTip || mergeTip == null) { return null; } if (RefNames.REFS_CONFIG.equals(branchUpdate.getName())) { try { ProjectConfig cfg = new ProjectConfig(destProject.getProject().getNameKey()); cfg.load(repo, mergeTip); } catch (Exception e) { throw new MergeException("Submit would store invalid" + " project configuration " + mergeTip.name() + " for " + destProject.getProject().getName(), e); } } branchUpdate.setRefLogIdent(refLogIdent); 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) { tagCache.updateFastForward(destBranch.getParentKey(), branchUpdate.getName(), branchUpdate.getOldObjectId(), mergeTip); } if (RefNames.REFS_CONFIG.equals(branchUpdate.getName())) { projectCache.evict(destProject.getProject()); destProject = projectCache.get(destProject.getProject().getNameKey()); repoManager.setProjectDescription( destProject.getProject().getNameKey(), destProject.getProject().getDescription()); } return branchUpdate; case LOCK_FAILURE: String msg; if (strategy.retryOnLockFailure()) { mergeQueue.recheckAfter(destBranch, LOCK_FAILURE_RETRY_DELAY, MILLISECONDS); msg = "will retry"; } else { msg = "will not retry"; } throw new IOException(branchUpdate.getResult().name() + ", " + msg); default: throw new IOException(branchUpdate.getResult().name()); } } catch (IOException e) { throw new MergeException("Cannot update " + branchUpdate.getName(), e); } }