/** {@inheritDoc} */ @Override public void create(boolean bare) throws IOException { if (exists()) throw new IOException(MessageFormat.format( JGitText.get().repositoryAlreadyExists, "")); //$NON-NLS-1$ String master = Constants.R_HEADS + Constants.MASTER; RefUpdate.Result result = updateRef(Constants.HEAD, true).link(master); if (result != RefUpdate.Result.NEW) throw new IOException(result.name()); }
throw new JGitInternalException(MessageFormat.format( JGitText.get().deleteTagUnexpectedResult, deleteResult.name()));
throw new JGitInternalException(MessageFormat.format( JGitText.get().deleteBranchUnexpectedResult, deleteResult.name()));
if (failedResult(trackingResult)) { if (pr.getMessages() != null && pr.getMessages().length() > 0) { throw new JGitFlowGitAPIException("error pushing to " + branchToPush + " - status: " + trackingResult.name() + " - " + pr.getMessages()); } else { throw new JGitFlowGitAPIException("error pushing to " + branchToPush + " - " + trackingResult.name());
case REJECTED_CURRENT_BRANCH : throw new RepositoryClientException("could not checkout, status " + ru.getResult().name());
setResult(Result.REJECTED_OTHER_REASON, r.name()); break;
return "[" + r.name() + "]"; //$NON-NLS-1$//$NON-NLS-2$
@Override public void create(boolean bare) throws IOException { if (!bare) throw new IllegalArgumentException( DhtText.get().repositoryMustBeBare); if (getObjectDatabase().exists()) throw new DhtException(MessageFormat.format( DhtText.get().repositoryAlreadyExists, name.asString())); try { key = db.repository().nextKey(); db.repositoryIndex().putUnique(name, key); } catch (TimeoutException err) { throw new DhtTimeoutException(MessageFormat.format( DhtText.get().timeoutLocatingRepository, name), err); } String master = Constants.R_HEADS + Constants.MASTER; RefUpdate.Result result = updateRef(Constants.HEAD, true).link(master); if (result != RefUpdate.Result.NEW) throw new IOException(result.name()); }
@Override public void create(boolean bare) throws IOException { if (!bare) throw new IllegalArgumentException( DhtText.get().repositoryMustBeBare); if (getObjectDatabase().exists()) throw new DhtException(MessageFormat.format( DhtText.get().repositoryAlreadyExists, name.asString())); try { key = db.repository().nextKey(); db.repositoryIndex().putUnique(name, key); } catch (TimeoutException err) { throw new DhtTimeoutException(MessageFormat.format( DhtText.get().timeoutLocatingRepository, name), err); } String master = Constants.R_HEADS + Constants.MASTER; RefUpdate.Result result = updateRef(Constants.HEAD, true).link(master); if (result != RefUpdate.Result.NEW) throw new IOException(result.name()); }
@Override public boolean push(@NotNull Repository repository, @NotNull ObjectId ReceiveId, @NotNull String branch, @NotNull User userInfo) throws SVNException, IOException { final RefUpdate refUpdate = repository.updateRef(branch); refUpdate.getOldObjectId(); refUpdate.setNewObjectId(ReceiveId); runReceiveHook(repository, refUpdate, SVNErrorCode.REPOS_HOOK_FAILURE, preReceive, userInfo); runUpdateHook(repository, refUpdate, update, userInfo); final RefUpdate.Result result = refUpdate.update(); switch (result) { case REJECTED: return false; case NEW: case FAST_FORWARD: runReceiveHook(repository, refUpdate, SVNErrorCode.REPOS_POST_COMMIT_HOOK_FAILED, postReceive, userInfo); return true; default: log.error("Unexpected push error: {}", result); throw new SVNException(SVNErrorMessage.create(SVNErrorCode.IO_WRITE_ERROR, result.name())); } }
public RefUpdateException(RefUpdate.Result result) { super(result.name()); this.result = result; }
/** {@inheritDoc} */ @Override public void create(boolean bare) throws IOException { if (exists()) throw new IOException(MessageFormat.format( JGitText.get().repositoryAlreadyExists, "")); //$NON-NLS-1$ String master = Constants.R_HEADS + Constants.MASTER; RefUpdate.Result result = updateRef(Constants.HEAD, true).link(master); if (result != RefUpdate.Result.NEW) throw new IOException(result.name()); }
@Override public void create(boolean bare) throws IOException { if (exists()) throw new IOException(MessageFormat.format( JGitText.get().repositoryAlreadyExists, "")); //$NON-NLS-1$ String master = Constants.R_HEADS + Constants.MASTER; RefUpdate.Result result = updateRef(Constants.HEAD, true).link(master); if (result != RefUpdate.Result.NEW) throw new IOException(result.name()); }
public static void validate(RefUpdate.Result result) { switch(result) { case REJECTED_CURRENT_BRANCH: throw new RefUpdateRejectedCurrentBranchException(result.name()); case REJECTED: throw new RefUpdateRejectedException(result.name()); case LOCK_FAILURE: throw new RefUpdateLockFailureException(result.name()); case IO_FAILURE: throw new RefUpdateIOFailureException(result.name()); } }
public static void validate(@Nonnull RefUpdate.Result result) { switch(result) { case REJECTED_CURRENT_BRANCH: throw new RefUpdateRejectedCurrentBranchException(result.name()); case REJECTED: throw new RefUpdateRejectedException(result.name()); case LOCK_FAILURE: throw new RefUpdateLockFailureException(result.name()); case IO_FAILURE: throw new RefUpdateIOFailureException(result.name()); } }
public static void validate(RefUpdate.Result result) { switch(result) { case REJECTED_CURRENT_BRANCH: throw new RefUpdateRejectedCurrentBranchException(result.name()); case REJECTED: throw new RefUpdateRejectedException(result.name()); case LOCK_FAILURE: throw new RefUpdateLockFailureException(result.name()); case IO_FAILURE: throw new RefUpdateIOFailureException(result.name()); } }
throw new JGitInternalException(MessageFormat.format(JGitText .get().createBranchUnexpectedResult, updateResult .name()));
throw new JGitInternalException(MessageFormat.format(JGitText .get().renameBranchUnexpectedResult, renameResult .name()));
setResult(Result.REJECTED_OTHER_REASON, r.name()); break;