diff options
author | Matthias Sohn <matthias.sohn@sap.com> | 2019-01-20 21:48:09 +0100 |
---|---|---|
committer | Matthias Sohn <matthias.sohn@sap.com> | 2019-01-21 00:54:15 +0100 |
commit | d614ba3334651310b32147ea383675f13aef72c0 (patch) | |
tree | cc9d415f6018b51cd55b414909fa456d8738ca00 /org.eclipse.jgit.pgm/src | |
parent | 67910b057092c361bee3ae25be560187b1c12277 (diff) | |
download | jgit-d614ba3334651310b32147ea383675f13aef72c0.tar.gz jgit-d614ba3334651310b32147ea383675f13aef72c0.zip |
pgm: Fix missing braces in Merge command
Change-Id: I39495d832ff4e48a97182faef88871902d3edb11
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
Diffstat (limited to 'org.eclipse.jgit.pgm/src')
-rw-r--r-- | org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Merge.java | 28 |
1 files changed, 18 insertions, 10 deletions
diff --git a/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Merge.java b/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Merge.java index 0f583bd1cc..8b48bbd162 100644 --- a/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Merge.java +++ b/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Merge.java @@ -105,23 +105,26 @@ class Merge extends TextBuiltin { /** {@inheritDoc} */ @Override protected void run() { - if (squash && ff == FastForwardMode.NO_FF) + if (squash && ff == FastForwardMode.NO_FF) { throw die(CLIText.get().cannotCombineSquashWithNoff); + } // determine the merge strategy if (strategyName != null) { mergeStrategy = MergeStrategy.get(strategyName); - if (mergeStrategy == null) + if (mergeStrategy == null) { throw die(MessageFormat.format( CLIText.get().unknownMergeStrategy, strategyName)); + } } try { // determine the other revision we want to merge with HEAD final Ref srcRef = db.findRef(ref); final ObjectId src = db.resolve(ref + "^{commit}"); //$NON-NLS-1$ - if (src == null) + if (src == null) { throw die(MessageFormat .format(CLIText.get().refDoesNotExistOrNoCommit, ref)); + } Ref oldHead = getOldHead(); MergeResult result; @@ -129,13 +132,15 @@ class Merge extends TextBuiltin { MergeCommand mergeCmd = git.merge().setStrategy(mergeStrategy) .setSquash(squash).setFastForward(ff) .setCommit(!noCommit); - if (srcRef != null) + if (srcRef != null) { mergeCmd.include(srcRef); - else + } else { mergeCmd.include(src); + } - if (message != null) + if (message != null) { mergeCmd.setMessage(message); + } try { result = mergeCmd.call(); @@ -146,8 +151,9 @@ class Merge extends TextBuiltin { switch (result.getMergeStatus()) { case ALREADY_UP_TO_DATE: - if (squash) + if (squash) { outw.print(CLIText.get().nothingToSquash); + } outw.println(CLIText.get().alreadyUpToDate); break; case FAST_FORWARD: @@ -162,8 +168,9 @@ class Merge extends TextBuiltin { break; case CHECKOUT_CONFLICT: outw.println(CLIText.get().mergeCheckoutConflict); - for (String collidingPath : result.getCheckoutConflicts()) + for (String collidingPath : result.getCheckoutConflicts()) { outw.println("\t" + collidingPath); //$NON-NLS-1$ + } outw.println(CLIText.get().mergeCheckoutFailed); break; case CONFLICTING: @@ -189,10 +196,11 @@ class Merge extends TextBuiltin { break; case MERGED: String name; - if (!isMergedInto(oldHead, src)) + if (!isMergedInto(oldHead, src)) { name = mergeStrategy.getName(); - else + } else { name = "recursive"; //$NON-NLS-1$ + } outw.println( MessageFormat.format(CLIText.get().mergeMadeBy, name)); break; |