Example usage for org.eclipse.jgit.api PullCommand getRebaseMode

List of usage examples for org.eclipse.jgit.api PullCommand getRebaseMode

Introduction

In this page you can find the example usage for org.eclipse.jgit.api PullCommand getRebaseMode.

Prototype

public static BranchRebaseMode getRebaseMode(String branchName, Config config) 

Source Link

Document

Reads the rebase mode to use for a pull command from the repository configuration.

Usage

From source file:org.eclipse.egit.ui.internal.pull.PullWizardPage.java

License:Open Source License

private void setDefaultUpstreamConfig() {
    String branchName = Repository.shortenRefName(this.fullBranch);
    BranchConfig branchConfig = new BranchConfig(repository.getConfig(), branchName);
    boolean alreadyConfigured = branchConfig.getMerge() != null;
    BranchRebaseMode config;/*w w w .  j  ava2 s .  c  o m*/
    if (alreadyConfigured) {
        config = PullCommand.getRebaseMode(branchName, repository.getConfig());
    } else {
        config = CreateLocalBranchOperation.getDefaultUpstreamConfig(repository,
                Constants.R_REMOTES + Constants.DEFAULT_REMOTE_NAME + "/" + branchName); //$NON-NLS-1$
    }
    this.upstreamConfig = config;
}

From source file:org.eclipse.egit.ui.internal.push.PushBranchPage.java

License:Open Source License

private void setDefaultUpstreamConfig() {
    if (this.ref != null) {
        String branchName = Repository.shortenRefName(ref.getName());
        BranchConfig branchConfig = new BranchConfig(repository.getConfig(), branchName);
        boolean alreadyConfigured = branchConfig.getMerge() != null;
        BranchRebaseMode config;/*from  w ww. ja v a 2 s . c om*/
        if (alreadyConfigured) {
            config = PullCommand.getRebaseMode(branchName, repository.getConfig());
        } else {
            config = CreateLocalBranchOperation.getDefaultUpstreamConfig(repository,
                    Constants.R_REMOTES + Constants.DEFAULT_REMOTE_NAME + "/" + branchName); //$NON-NLS-1$
        }
        this.upstreamConfig = config;
        this.upstreamConfigComponent.setUpstreamConfig(this.upstreamConfig);
    }
}