use of org.eclipse.jgit.lib.BranchConfig in project egit by eclipse.
the class PushBranchPage method hasDifferentUpstreamConfiguration.
private boolean hasDifferentUpstreamConfiguration() {
String branchName = Repository.shortenRefName(ref.getName());
BranchConfig branchConfig = new BranchConfig(repository.getConfig(), branchName);
String remote = branchConfig.getRemote();
// No upstream config -> don't show warning
if (remote == null) {
return false;
}
if (!remote.equals(remoteConfig.getName())) {
return true;
}
String merge = branchConfig.getMerge();
if (merge == null || !merge.equals(getFullRemoteReference())) {
return true;
}
if (branchConfig.getRebaseMode() != upstreamConfig) {
return true;
}
return false;
}
use of org.eclipse.jgit.lib.BranchConfig in project egit by eclipse.
the class PullWizardPage method hasDifferentUpstreamConfiguration.
private boolean hasDifferentUpstreamConfiguration() {
String branchName = Repository.shortenRefName(this.fullBranch);
BranchConfig branchConfig = new BranchConfig(repository.getConfig(), branchName);
String remote = branchConfig.getRemote();
// No upstream config -> don't show warning
if (remote == null) {
return false;
}
if (!remote.equals(remoteConfig.getName())) {
return true;
}
String merge = branchConfig.getMerge();
if (merge == null || !merge.equals(getFullRemoteReference())) {
return true;
}
if (branchConfig.getRebaseMode() != getUpstreamConfig()) {
return true;
}
return false;
}
use of org.eclipse.jgit.lib.BranchConfig in project egit by eclipse.
the class PullWizardPage method setDefaultUpstreamConfig.
private void setDefaultUpstreamConfig() {
String branchName = Repository.shortenRefName(this.fullBranch);
BranchConfig branchConfig = new BranchConfig(repository.getConfig(), branchName);
boolean alreadyConfigured = branchConfig.getMerge() != null;
BranchRebaseMode config;
if (alreadyConfigured) {
config = PullCommand.getRebaseMode(branchName, repository.getConfig());
} else {
config = CreateLocalBranchOperation.getDefaultUpstreamConfig(repository, Constants.R_REMOTES + Constants.DEFAULT_REMOTE_NAME + "/" + // $NON-NLS-1$
branchName);
}
this.upstreamConfig = config;
}
use of org.eclipse.jgit.lib.BranchConfig in project egit by eclipse.
the class PullWizardPage method setRemoteConfigs.
private void setRemoteConfigs() {
remoteSelectionCombo.setItems(remoteConfigs);
if (this.head != null) {
String branchName = Repository.shortenRefName(this.head.getName());
BranchConfig branchConfig = new BranchConfig(repository.getConfig(), branchName);
String remoteName = branchConfig.getRemote();
if (remoteName != null) {
for (RemoteConfig rc : remoteConfigs) {
if (remoteName.equals(rc.getName()))
remoteSelectionCombo.setSelectedRemote(rc);
}
}
}
remoteConfig = remoteSelectionCombo.getSelectedRemote();
setRefAssist(remoteConfig);
}
Aggregations