Merge test will be performed according to {@link #isForceUpdate()}.
This is the same as:
return update(new RevWalk(getRepository()));
14631464146514661467146814691470147114721473
} final RefUpdate ru = repo.updateRef(ps.getRefName()); ru.setNewObjectId(c); ru.disableRefLog(); if (ru.update(rp.getRevWalk()) != RefUpdate.Result.NEW) { throw new IOException("Failed to create ref " + ps.getRefName() + " in " + repo.getDirectory() + ": " + ru.getResult()); } replication.fire(project.getNameKey(), ru.getName()); hooks.doPatchsetCreatedHook(result.change, ps, db);
378379380381382383384385386387388
}); final RefUpdate ru = git.updateRef(rebasedPatchSet.getRefName()); ru.setNewObjectId(rebasedCommitId); ru.disableRefLog(); if (ru.update(revWalk) != RefUpdate.Result.NEW) { throw new IOException("Failed to create ref " + rebasedPatchSet.getRefName() + " in " + git.getDirectory() + ": " + ru.getResult()); }
494495496497498499500501502503504
db.changes().insert(Collections.singleton(change)); final RefUpdate ru = git.updateRef(ps.getRefName()); ru.setNewObjectId(id); ru.disableRefLog(); if (ru.update(revWalk) != RefUpdate.Result.NEW) { throw new IOException("Failed to create ref " + ps.getRefName() + " in " + git.getDirectory() + ": " + ru.getResult()); } replication.fire(db.changes().get(changeId).getProject(), ru.getName());
183184185186187188189190191192193
updateRef.setRefLogMessage(refLogMessage, false); Result updateResult; if (exists && force) updateResult = updateRef.forceUpdate(); else updateResult = updateRef.update(); setCallable(false); boolean ok = false; switch (updateResult) {
178179180181182183184185186187188
RefUpdate refUpdate = repo .updateRef(head.getTarget().getName()); refUpdate.setNewObjectId(objectId); refUpdate.setExpectedOldObjectId(null); refUpdate.setRefLogMessage("initial pull", false); if (refUpdate.update() != Result.NEW) throw new NoHeadException( JGitText.get().commitOnRepoWithoutHEADCurrentlyNotSupported); setCallable(false); return new MergeResult(srcCommit, srcCommit, new ObjectId[] { null, srcCommit }, MergeStatus.FAST_FORWARD,
351352353354355356357358359360361
ConcurrentRefUpdateException { RefUpdate refUpdate = repo.updateRef(Constants.HEAD); refUpdate.setNewObjectId(newHeadId); refUpdate.setRefLogMessage(refLogMessage.toString(), false); refUpdate.setExpectedOldObjectId(oldHeadID); Result rc = refUpdate.update(); switch (rc) { case NEW: case FAST_FORWARD: return; case REJECTED:
161162163164165166167168169170171
throw die(MessageFormat.format(CLIText.get().branchAlreadyExists, newHead)); RefUpdate updateRef = db.updateRef(newRefName); updateRef.setNewObjectId(startAt); updateRef.setForceUpdate(createForce); updateRef.setRefLogMessage(MessageFormat.format(CLIText.get().branchCreatedFrom, startBranch), false); Result update = updateRef.update(); if (update == Result.REJECTED) throw die(MessageFormat.format(CLIText.get().couldNotCreateBranch, newHead, update.toString())); } else { if (verbose) rw = new RevWalk(db);
180181182183184185186187188189190
154155156157158159160161162163164
255256257258259260261262263264265