Merge test will be performed according to {@link #isForceUpdate()}.
This is the same as:
return update(new RevWalk(getRepository()));
654655656657658659660661662663664
RefUpdate rup = repo.updateRef(headName); rup.setExpectedOldObjectId(oldCommit); rup.setNewObjectId(newCommit); rup.setRefLogMessage("Fast-foward from " + oldCommit.name() + " to " + newCommit.name(), false); Result res = rup.update(walk); switch (res) { case FAST_FORWARD: case NO_CHANGE: case FORCED: break;
141142143144145146147148149150151
String refName = Constants.R_TAGS + newTag.getTag(); RefUpdate tagRef = repo.updateRef(refName); tagRef.setNewObjectId(tagId); tagRef.setForceUpdate(forceUpdate); tagRef.setRefLogMessage("tagged " + name, false); Result updateResult = tagRef.update(revWalk); switch (updateResult) { case NEW: case FORCED: return repo.getRef(refName); case LOCK_FAILURE:
747748749750751752753754755756757
215216217218219220221222223224225
int remainingLockFailureCalls = MAX_LOCK_FAILURE_CALLS; RefUpdate refUpdate = createRefUpdate(repo, oursCommit, baseCommit); for (;;) { final Result result = refUpdate.update(); if (result == Result.LOCK_FAILURE) { if (--remainingLockFailureCalls > 0) { Thread.sleep(SLEEP_ON_LOCK_FAILURE_MS); } else {
330331332333334335336337338339340
rfu.setExpectedOldObjectId(currentCommitId); rfu .setRefLogMessage("Submit to " + subscriber.getParentKey().get(), true); switch (rfu.update()) { case NEW: case FAST_FORWARD: replication.fire(subscriber.getParentKey(), rfu.getName()); // TODO since this is performed "in the background" no mail will be // sent to inform users about the updated branch
252253254255256257258259260261262
} RefUpdate ru = db.updateRef(refName); ru.setExpectedOldObjectId(ObjectId.zeroId()); ru.setNewObjectId(src); RefUpdate.Result result = ru.update(); switch (result) { case NEW: revision = rw.parseCommit(ru.getNewObjectId()); update.replicate(ru.getName()); return revision;
285286287288289290291292293294295
} ru.setNewObjectId(src); ru.disableRefLog(); inserter.flush(); switch (ru.update(rw)) { case NEW: case FAST_FORWARD: revision = rw.parseCommit(ru.getNewObjectId()); update.replicate(ru.getName()); return revision;
273274275276277278279280281282283
oi.flush(); for (String ref : refs) { RefUpdate ru = repo.updateRef(ref); ru.setNewObjectId(id); final Result result = ru.update(); switch (result) { case NEW: referenceUpdated.fire(project, ref); break; default: {
137138139140141142143144145146147
final RefUpdate u = repo.updateRef(refname); u.setExpectedOldObjectId(ObjectId.zeroId()); u.setNewObjectId(object.copy()); u.setRefLogIdent(identifiedUser.newRefLogIdent()); u.setRefLogMessage("created via web from " + startingRevision, false); final RefUpdate.Result result = u.update(rw); switch (result) { case FAST_FORWARD: case NEW: case NO_CHANGE: referenceUpdated.fire(name.getParentKey(), refname);
11611162116311641165116611671168116911701171
} final RefUpdate ru = repo.updateRef(ps.getRefName()); ru.setNewObjectId(c); ru.disableRefLog(); if (ru.update(walk) != RefUpdate.Result.NEW) { throw new IOException("Failed to create ref " + ps.getRefName() + " in " + repo.getDirectory() + ": " + ru.getResult()); } replication.fire(project.getNameKey(), ru.getName());