Uploaded image for project: 'Tools (JBoss Tools)'
  1. Tools (JBoss Tools)
  2. JBIDE-12144

EGitUtils#push is throwing an exception if push fails. It should use the same semantics as EGit

XMLWordPrintable

    • Low

      EgitUtils#push throws an exception if the push failed because of ex. "non fastforward push".

      private static PushOperationResult push(Repository repository, RemoteConfig remoteConfig, boolean force, IProgressMonitor monitor) throws CoreException {
      	...
      	PushOperationResult pushResult = op.getOperationResult();
      	if (hasFailedEntries(pushResult)) {
      		throw new CoreException(
      				EGitCoreActivator.createErrorStatus(
      						NLS.bind("Could not push repository {0}: {1}",
      								repository.toString(), getErrors(pushResult))
      						, null));
      	}
      	return pushResult;
      

      EGit is not throwing an exception in this case. You simply get the failure in the PushResult object you'll have to look at.
      EGitUtils#push is thus changing the API semantics of EGit and it shouldn't.

            adietish@redhat.com André Dietisheim
            adietish@redhat.com André Dietisheim
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: