From abb184b15bd45f50a71832419cb1b0b1b66400c4 Mon Sep 17 00:00:00 2001 From: Jesse Glick Date: Mon, 20 Jun 2016 16:56:06 -0400 Subject: [PATCH] The original GitException from a failed merge was good enough, no need to rethrow it. --- .../plugins/gitclient/CliGitAPIImpl.java | 36 +++++++++---------- 1 file changed, 16 insertions(+), 20 deletions(-) diff --git a/src/main/java/org/jenkinsci/plugins/gitclient/CliGitAPIImpl.java b/src/main/java/org/jenkinsci/plugins/gitclient/CliGitAPIImpl.java index 72833e44f7..c49490f51c 100644 --- a/src/main/java/org/jenkinsci/plugins/gitclient/CliGitAPIImpl.java +++ b/src/main/java/org/jenkinsci/plugins/gitclient/CliGitAPIImpl.java @@ -565,30 +565,26 @@ public MergeCommand setCommit(boolean commit) { public void execute() throws GitException, InterruptedException { ArgumentListBuilder args = new ArgumentListBuilder(); args.add("merge"); - try { - if(squash) { - args.add("--squash"); - } + if(squash) { + args.add("--squash"); + } - if(!commit){ - args.add("--no-commit"); - } + if(!commit){ + args.add("--no-commit"); + } - if (comment != null && !comment.isEmpty()) { - args.add("-m"); - args.add(comment); - } + if (comment != null && !comment.isEmpty()) { + args.add("-m"); + args.add(comment); + } - if (strategy != null && !strategy.isEmpty() && !strategy.equals(MergeCommand.Strategy.DEFAULT.toString())) { - args.add("-s"); - args.add(strategy); - } - args.add(fastForwardMode); - args.add(rev.name()); - launchCommand(args); - } catch (GitException e) { - throw new GitException("Could not merge " + rev, e); + if (strategy != null && !strategy.isEmpty() && !strategy.equals(MergeCommand.Strategy.DEFAULT.toString())) { + args.add("-s"); + args.add(strategy); } + args.add(fastForwardMode); + args.add(rev.name()); + launchCommand(args); } }; }