michael-o commented on code in PR #203:
URL: https://github.com/apache/maven-scm/pull/203#discussion_r1551698288
##########
maven-scm-providers/maven-scm-providers-git/maven-scm-provider-jgit/src/main/java/org/apache/maven/scm/provider/git/jgit/command/checkin/JGitCheckInCommand.java:
##########
@@ -139,7 +141,20 @@ protected CheckInScmResult executeCheckInCommand(
}
RefSpec refSpec = new RefSpec(Constants.R_HEADS + branch + ":"
+ Constants.R_HEADS + branch);
logger.info("push changes to remote... " + refSpec);
- JGitUtils.push(git, (GitScmProviderRepository) repo, refSpec);
+ Iterable<PushResult> pushResultList = JGitUtils.push(git,
(GitScmProviderRepository) repo, refSpec);
+
+ for (PushResult pushResult : pushResultList) {
+ for (RemoteRefUpdate remoteRefUpdate :
pushResult.getRemoteUpdates()) {
+ if (remoteRefUpdate.getStatus() !=
RemoteRefUpdate.Status.OK) {
+ return new CheckInScmResult(
+ "JGit checkin",
+ "The git-push command failed, with status:
"
+ +
remoteRefUpdate.getStatus().name(),
Review Comment:
I think we can reduce to `getStatus()` and the implicit string conv will do
the magic for us.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]