/** * Delete the ref. * <p> * This is the same as: * * <pre> * return delete(new RevWalk(getRepository())); * </pre> * * @return the result status of the delete. * @throws java.io.IOException */ public Result delete() throws IOException { try (RevWalk rw = new RevWalk(getRepository())) { return delete(rw); } }
private void deleteRef(Ref stashRef) { try { Result result = createRefUpdate(stashRef).delete(); if (Result.FORCED != result) throw new JGitInternalException(MessageFormat.format( JGitText.get().stashDropDeleteRefFailed, result)); } catch (IOException e) { throw new JGitInternalException(JGitText.get().stashDropFailed, e); } }
/** * Update locally stored tracking branch with the new object. * * @param walk * walker used for checking update properties. * @throws java.io.IOException * when I/O error occurred during update */ protected void updateTrackingRef(RevWalk walk) throws IOException { if (isDelete()) trackingRefUpdate.setResult(localUpdate.delete(walk)); else trackingRefUpdate.setResult(localUpdate.update(walk)); }
RefUpdate update = repo.updateRef(fullName); update.setForceUpdate(true); Result deleteResult = update.delete();
/** {@inheritDoc} */ @Override protected Result doRename() throws IOException { // TODO Correctly handle renaming foo/bar to foo. // TODO Batch these together into one log update. destination.setExpectedOldObjectId(ObjectId.zeroId()); destination.setNewObjectId(source.getRef().getObjectId()); switch (destination.update()) { case NEW: source.delete(); return Result.RENAMED; default: return destination.getResult(); } } }
update.setRefLogMessage("branch deleted", false); //$NON-NLS-1$ update.setForceUpdate(true); Result deleteResult = update.delete();
RefUpdate rud = newUpdate(cmd); monitor.update(1); cmd.setResult(rud.delete(walk));
private static void deleteRef(Repository repo, String branchName, String revision) throws IOException { RefUpdate u = repo.updateRef(branchName, true); u.setForceUpdate(true); String resultMessage = "deleting branch "+branchName+" at revision " + revision; u.setRefLogMessage(resultMessage , true); Result result = u.delete(); log.info(resultMessage + " result = " + result); }
setResult(ru.delete(rp.getRevWalk())); break;
public static void deleteBranch(@Nonnull String name, @Nonnull Repository repo) throws IOException { String refName = RefUtils.ensureBranchRefName(name); if(prepareDeleteBranch(refName, repo)) { RefUpdate update = repo.updateRef(refName); update.setRefLogMessage("branch deleted", false); update.setForceUpdate(true); RefUpdateValidator.validate(update.delete()); } }
private void deleteRef(final Ref stashRef) { try { Result result = createRefUpdate(stashRef).delete(); if (Result.FORCED != result) throw new JGitInternalException(MessageFormat.format( JGitText.get().stashDropDeleteRefFailed, result)); } catch (IOException e) { throw new JGitInternalException(JGitText.get().stashDropFailed, e); } }
private void deleteRef(Ref stashRef) { try { Result result = createRefUpdate(stashRef).delete(); if (Result.FORCED != result) throw new JGitInternalException(MessageFormat.format( JGitText.get().stashDropDeleteRefFailed, result)); } catch (IOException e) { throw new JGitInternalException(JGitText.get().stashDropFailed, e); } }
private void deleteAllRefs() throws Exception { final RevWalk rw = new RevWalk(db); Map<String, Ref> refs = db.getRefDatabase().getRefs(ALL); for (final Ref r : refs.values()) { if (Constants.HEAD.equals(r.getName())) continue; final RefUpdate u = db.updateRef(r.getName()); u.setForceUpdate(true); u.delete(rw); } }
/** * Update locally stored tracking branch with the new object. * * @param walk * walker used for checking update properties. * @throws IOException * when I/O error occurred during update */ protected void updateTrackingRef(final RevWalk walk) throws IOException { if (isDelete()) trackingRefUpdate.setResult(localUpdate.delete(walk)); else trackingRefUpdate.setResult(localUpdate.update(walk)); }
/** * Update locally stored tracking branch with the new object. * * @param walk * walker used for checking update properties. * @throws java.io.IOException * when I/O error occurred during update */ protected void updateTrackingRef(RevWalk walk) throws IOException { if (isDelete()) trackingRefUpdate.setResult(localUpdate.delete(walk)); else trackingRefUpdate.setResult(localUpdate.update(walk)); }
public static void deleteBranch(String name, Repository repo) throws IOException { String refName = fullBranchName(name); if(prepareDeleteBranch(refName, repo)) { RefUpdate update = repo.updateRef(refName); update.setRefLogMessage("branch deleted", false); update.setForceUpdate(true); RefUpdateValidator.validate(update.delete()); } }
public static void deleteBranch(String name, Repository repo) throws IOException { String refName = fullBranchName(name); if(prepareDeleteBranch(refName, repo)) { RefUpdate update = repo.updateRef(refName); update.setRefLogMessage("branch deleted", false); update.setForceUpdate(true); RefUpdateValidator.validate(update.delete()); } }
@Override protected Result doRename() throws IOException { // TODO(spearce) Correctly handle renameing foo/bar to foo. destination.setExpectedOldObjectId(ObjectId.zeroId()); destination.setNewObjectId(source.getRef().getObjectId()); switch (destination.update()) { case NEW: source.delete(); return Result.RENAMED; default: return destination.getResult(); } } }
@Override protected Result doRename() throws IOException { // TODO(spearce) Correctly handle renameing foo/bar to foo. destination.setExpectedOldObjectId(ObjectId.zeroId()); destination.setNewObjectId(source.getRef().getObjectId()); switch (destination.update()) { case NEW: source.delete(); return Result.RENAMED; default: return destination.getResult(); } } }
source.setForceUpdate(true); source.disableRefLog(); if (source.delete(rw) != Result.FORCED) { renameLog(tmp, source); if (updateHEAD)