Example usage for org.eclipse.jgit.lib BranchConfig isRemoteLocal

List of usage examples for org.eclipse.jgit.lib BranchConfig isRemoteLocal

Introduction

In this page you can find the example usage for org.eclipse.jgit.lib BranchConfig isRemoteLocal.

Prototype

public boolean isRemoteLocal() 

Source Link

Document

Whether the "remote" setting points to the local repository (with #LOCAL_REPOSITORY )

Usage

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

License:Open Source License

private String getSuggestedBranchName() {
    if (fullBranch != null) {
        String branchName = Repository.shortenRefName(fullBranch);
        StoredConfig config = repository.getConfig();
        BranchConfig branchConfig = new BranchConfig(config, branchName);
        String merge = branchConfig.getMerge();
        if (!branchConfig.isRemoteLocal() && merge != null && merge.startsWith(Constants.R_HEADS)) {
            return Repository.shortenRefName(merge);
        }/* w  w w . ja  v  a2 s .c om*/
    }
    return ""; //$NON-NLS-1$
}

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

License:Open Source License

private String getSuggestedBranchName() {
    if (ref != null && !ref.getName().startsWith(Constants.R_REMOTES)) {
        StoredConfig config = repository.getConfig();
        String branchName = Repository.shortenRefName(ref.getName());

        BranchConfig branchConfig = new BranchConfig(config, branchName);
        String merge = branchConfig.getMerge();
        if (!branchConfig.isRemoteLocal() && merge != null && merge.startsWith(Constants.R_HEADS))
            return Repository.shortenRefName(merge);

        return branchName;
    } else {//from www .ja va  2  s . c  o  m
        return ""; //$NON-NLS-1$
    }
}