Java 类org.eclipse.jgit.api.RebaseCommand.Operation 实例源码

项目:verigreen    文件:JGitOperator.java   
@Override
public boolean rebase(String upStreamBranchName) {

    RebaseCommand command = _git.rebase();
    RebaseResult result = null;
    try {
        command.setUpstream(upStreamBranchName);
        result = command.call();
        // if there are merge conflicts (rebase interactive) - reset the repository
        if (!result.getStatus().isSuccessful()) {
            _git.rebase().setOperation(Operation.ABORT).call();
        }
    } catch (Throwable e) {
        throw new RuntimeException(String.format(
                "Failed to rebase with upstream [%s]",
                upStreamBranchName), e);
    }

    return result.getStatus().isSuccessful();
}
项目:incubator-netbeans    文件:CherryPickCommand.java   
static Operation getOperation (GitClient.RebaseOperationType operation) {
    return Operation.valueOf(operation.name());
}
项目:incubator-netbeans    文件:RebaseCommand.java   
static Operation getOperation (GitClient.RebaseOperationType operation) {
    return Operation.valueOf(operation.name());
}
项目:rebazer    文件:RebaseService.java   
@SneakyThrows
public boolean rebase( final Repository repo, final PullRequest pullRequest ) {
    log.info( "Rebasing {}.", pullRequest );

    try {
        final Git repository = repo.getGit();
        final CredentialsProvider credentials = repo.getCredentials();
        repository.fetch().setCredentialsProvider( credentials ).setRemoveDeletedRefs( true ).call();
        repository.checkout().setCreateBranch( true ).setName( pullRequest.getSource() )
                .setStartPoint( "origin/" + pullRequest.getSource() ).call();

        final RebaseResult rebaseResult =
                repository.rebase().setUpstream( "origin/" + pullRequest.getDestination() ).call();

        switch ( rebaseResult.getStatus() ) {
            case UP_TO_DATE:
                log.warn( "Why rebasing up to date {}?", pullRequest );
                return true;

            case FAST_FORWARD:
                log.warn( "Why creating {} without changes?", pullRequest );
                // fall-through

            case OK:
                repository.push().setCredentialsProvider( credentials ).setForce( true ).call();
                return true;

            case STOPPED:
                log.info( "Merge conflict in {}", pullRequest );
                repository.rebase().setOperation( Operation.ABORT ).call();
                return false;

            default:
                repository.rebase().setOperation( Operation.ABORT ).call();
                throw new RuntimeException(
                        "For " + pullRequest + " rebase causes an unexpected result: " + rebaseResult.getStatus() );
        }
    } finally {
        cleanUp( repo );
    }
}
项目:github-merge    文件:GitService.java   
private void abortRebase(Git git) throws Exception {
    git.rebase().setOperation(Operation.ABORT)
        .setProgressMonitor(new NotificationProgressMonitor(request, notification))
        .call();
}