Merge test will be performed according to {@link #isForceUpdate()}.
This is the same as:
return update(new RevWalk(getRepository()));
403404405406407408409410411412413
protected void createBranch(ObjectId objectId, String branchName) throws IOException { RefUpdate updateRef = db.updateRef(branchName); updateRef.setNewObjectId(objectId); updateRef.update(); } protected void checkoutBranch(String branchName) throws IllegalStateException, IOException { RevWalk walk = new RevWalk(db);
155156157158159160161162163164165
} // Create the destination, logging the rename during the creation. dst.setExpectedOldObjectId(ObjectId.zeroId()); dst.setNewObjectId(objId); if (dst.update(rw) != Result.NEW) { // If we didn't create the destination we have to undo // our work. Put the log back and restore source. if (renameLog(destination, tmp)) renameLog(tmp, source); source.setExpectedOldObjectId(ObjectId.zeroId());
806807808809810811812813814815816
inserter.flush(); RefUpdate ru = repo.updateRef(Constants.HEAD); ru.setNewObjectId(commitId); ru.setExpectedOldObjectId(headId != null ? headId : ObjectId.zeroId()); Result rc = ru.update(rw); switch (rc) { case NEW: case FORCED: case FAST_FORWARD:
160161162163164165166167168169170
return super.isForceUpdate(); } }; update.setForceUpdate(true); update.setNewObjectId(b); return update.update(); } }); pool.submit(new Callable<Void>() { public Void call() throws Exception {
183184185186187188189190191192193
updateRef.setRefLogMessage(refLogMessage, false); Result updateResult; if (exists && force) updateResult = updateRef.forceUpdate(); else updateResult = updateRef.update(); setCallable(false); boolean ok = false; switch (updateResult) {
103104105106107108109110111112113
cb.parent(b1Tip).parent(b2Tip); cb.setTopLevelTree(merger.getResultTreeId()); RevCommit mergeCommit = cb.create(); RefUpdate u = repo.updateRef("refs/heads/b1"); u.setNewObjectId(mergeCommit); u.update(); RefUpdate update = repo.updateRef("refs/heads/b2"); update.setForceUpdate(true); update.delete();
7071727374757677787980
super.setUp(); RefUpdate createRemoteRefA = db .updateRef("refs/remotes/origin/remote-a"); createRemoteRefA.setNewObjectId(db.resolve("refs/heads/a")); createRemoteRefA.update(); RefUpdate createRemoteRefB = db .updateRef("refs/remotes/origin/remote-b"); createRemoteRefB.setNewObjectId(db.resolve("refs/heads/b")); createRemoteRefB.update();
7576777879808182838485
createRemoteRefA.update(); RefUpdate createRemoteRefB = db .updateRef("refs/remotes/origin/remote-b"); createRemoteRefB.setNewObjectId(db.resolve("refs/heads/b")); createRemoteRefB.update(); formatter = new MergeMessageFormatter(); } @Test
144145146147148149150151152153154
private void updateRef(Ref stashRef, ObjectId newId) { try { RefUpdate update = createRefUpdate(stashRef); update.setNewObjectId(newId); Result result = update.update(); switch (result) { case FORCED: case NEW: case NO_CHANGE: return;
12261227122812291230123112321233123412351236
RefUpdate rup = repo.updateRef(headName); rup.setExpectedOldObjectId(oldCommit); rup.setNewObjectId(newCommit); rup.setRefLogMessage("Fast-foward from " + oldCommit.name() //$NON-NLS-1$ + " to " + newCommit.name(), false); //$NON-NLS-1$ Result res = rup.update(walk); switch (res) { case FAST_FORWARD: case NO_CHANGE: case FORCED: break;