use of org.eclipse.egit.core.op.PushOperationResult in project egit by eclipse.
the class PushWizard method performFinish.
@Override
public boolean performFinish() {
boolean calledFromRepoPage = false;
if (getContainer().getCurrentPage() == repoPage)
calledFromRepoPage = true;
if (repoPage.getSelection().isConfigSelected() && refSpecPage.isSaveRequested()) {
saveRefSpecs();
}
if (repoPage.getStoreInSecureStore()) {
if (!SecureStoreUtils.storeCredentials(repoPage.getCredentials(), repoPage.getSelection().getURI()))
return false;
}
final PushOperation operation = createPushOperation(calledFromRepoPage);
if (operation == null)
return false;
UserPasswordCredentials credentials = repoPage.getCredentials();
if (credentials != null)
operation.setCredentialsProvider(new EGitCredentialsProvider(credentials.getUser(), credentials.getPassword()));
final PushOperationResult resultToCompare;
if (confirmPage.isShowOnlyIfChangedSelected()) {
resultToCompare = confirmPage.getConfirmedResult();
} else {
resultToCompare = null;
}
final Job job = new PushJob(NLS.bind(UIText.PushWizard_jobName, getURIsString(operation.getSpecification().getURIs())), localDb, operation, resultToCompare, getDestinationString(repoPage.getSelection()), true, PushMode.UPSTREAM);
job.setUser(true);
job.schedule();
repoPage.saveUriInPrefs();
return true;
}
Aggregations