Commit 656b18e0 authored by Jonathan Doklovic's avatar Jonathan Doklovic

Merge branch 'release/1.0-m5.1'

parents 9e34b336 a24f156c
# JGit-Flow
**Current Version: 1.0-m5**
**Current Version: 1.0-m5.1**
**Issue Tracker Has Moved To: [https://ecosystem.atlassian.net/browse/MJF](https://ecosystem.atlassian.net/browse/MJF)**
......
......@@ -4,7 +4,7 @@
<parent>
<groupId>external.atlassian.jgitflow</groupId>
<artifactId>jgitflow-parent</artifactId>
<version>1.0-m5</version>
<version>1.0-m5.1</version>
</parent>
<artifactId>jgit-flow-core</artifactId>
......
......@@ -18,8 +18,11 @@ import com.atlassian.jgitflow.core.util.RequirementHelper;
import org.eclipse.jgit.api.Git;
import org.eclipse.jgit.api.errors.GitAPIException;
import org.eclipse.jgit.lib.Constants;
import org.eclipse.jgit.lib.RefUpdate;
import org.eclipse.jgit.transport.PushResult;
import org.eclipse.jgit.transport.RefSpec;
import org.eclipse.jgit.transport.RemoteRefUpdate;
import org.eclipse.jgit.transport.TrackingRefUpdate;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
......@@ -94,9 +97,18 @@ public abstract class AbstractGitFlowCommand<C, T> implements Callable<T>, JGitF
for (PushResult pr : i)
{
reporter.infoText(getCommandName(), "messages: '" + pr.getMessages() + "'");
if (pr.getMessages() != null && pr.getMessages().length() > 0) {
// TODO: not sure if a message always means an error, so we may need to create a parameter to let the user control this
throw new JGitFlowGitAPIException("error pushing to " + branchToPush + " - " + pr.getMessages());
for(RemoteRefUpdate update : pr.getRemoteUpdates()) {
if (update.hasTrackingRefUpdate()) {
RefUpdate.Result trackingResult = update.getTrackingRefUpdate().getResult();
if (failedResult(trackingResult)) {
if (pr.getMessages() != null && pr.getMessages().length() > 0) {
throw new JGitFlowGitAPIException("error pushing to " + branchToPush + " - status: " + trackingResult.name() + " - " + pr.getMessages());
} else {
throw new JGitFlowGitAPIException("error pushing to " + branchToPush + " - " + trackingResult.name());
}
}
}
}
}
}
......@@ -115,6 +127,22 @@ public abstract class AbstractGitFlowCommand<C, T> implements Callable<T>, JGitF
}
}
private boolean failedResult(RefUpdate.Result trackingResult) {
boolean isFailed = false;
switch(trackingResult)
{
case LOCK_FAILURE:
case REJECTED:
case REJECTED_CURRENT_BRANCH:
case IO_FAILURE:
isFailed = true;
break;
}
return isFailed;
}
protected String runBeforeAndGetPrefixedBranchName(Iterable<ExtensionCommand> before, JGitFlowConstants.PREFIXES prefix) throws JGitFlowExtensionException
{
reporter.commandCall(getCommandName());
......
......@@ -3,7 +3,7 @@
<parent>
<artifactId>jgitflow-parent</artifactId>
<groupId>external.atlassian.jgitflow</groupId>
<version>1.0-m5</version>
<version>1.0-m5.1</version>
</parent>
<modelVersion>4.0.0</modelVersion>
......
......@@ -3,7 +3,7 @@
<parent>
<artifactId>jgitflow-parent</artifactId>
<groupId>external.atlassian.jgitflow</groupId>
<version>1.0-m5</version>
<version>1.0-m5.1</version>
</parent>
<modelVersion>4.0.0</modelVersion>
......
......@@ -4,7 +4,7 @@
<parent>
<groupId>external.atlassian.jgitflow</groupId>
<artifactId>jgitflow-parent</artifactId>
<version>1.0-m5</version>
<version>1.0-m5.1</version>
</parent>
<artifactId>jgitflow-maven-plugin</artifactId>
......
## Release Notes - Maven JGit Flow
### Version 1.0-m5.1
(18/May/2015)
#### Bug
* [MJF-228](https://ecosystem.atlassian.net/browse/MJF-228) - pushes fail if remote sends back *any* messages
### Version 1.0-m5
(14/May/2015)
#### Bug
......
......@@ -9,7 +9,7 @@
<groupId>external.atlassian.jgitflow</groupId>
<artifactId>jgitflow-parent</artifactId>
<version>1.0-m5</version>
<version>1.0-m5.1</version>
<packaging>pom</packaging>
......@@ -252,7 +252,7 @@
<plugin>
<groupId>external.atlassian.jgitflow</groupId>
<artifactId>jgitflow-maven-plugin</artifactId>
<version>1.0-m4.3</version>
<version>1.0.0-test_for_push-SNAPSHOT</version>
<inherited>false</inherited>
<configuration>
<allowSnapshots>true</allowSnapshots>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment