aboutsummaryrefslogtreecommitdiffstats
path: root/org.eclipse.jgit.pgm/src
diff options
context:
space:
mode:
authorMatthias Sohn <matthias.sohn@sap.com>2019-01-20 01:19:45 +0100
committerMatthias Sohn <matthias.sohn@sap.com>2019-01-20 01:19:45 +0100
commitbe2ae1e10342bef4a32b173079e97c08acb13169 (patch)
treec78498abcc2054dc173defe21f590247969d37eb /org.eclipse.jgit.pgm/src
parent4d4fe5230ebf1c8c0fb98ff0f169e02135e9d0e2 (diff)
downloadjgit-be2ae1e10342bef4a32b173079e97c08acb13169.tar.gz
jgit-be2ae1e10342bef4a32b173079e97c08acb13169.zip
Fix missing braces in Branch.run()
Change-Id: Ie8a757552846d2454017a95e20dc14fdf6a93982 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/Branch.java15
1 files changed, 10 insertions, 5 deletions
diff --git a/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Branch.java b/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Branch.java
index 7b3c958ef8..bac697f78e 100644
--- a/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Branch.java
+++ b/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Branch.java
@@ -207,22 +207,27 @@ class Branch extends TextBuiltin {
} else {
src = branch;
final Ref old = db.findRef(src);
- if (old == null)
+ if (old == null) {
throw die(MessageFormat.format(CLIText.get().doesNotExist, src));
- if (!old.getName().startsWith(Constants.R_HEADS))
+ }
+ if (!old.getName().startsWith(Constants.R_HEADS)) {
throw die(MessageFormat.format(CLIText.get().notABranch, src));
+ }
src = old.getName();
dst = otherBranch;
}
- if (!dst.startsWith(Constants.R_HEADS))
+ if (!dst.startsWith(Constants.R_HEADS)) {
dst = Constants.R_HEADS + dst;
- if (!Repository.isValidRefName(dst))
+ }
+ if (!Repository.isValidRefName(dst)) {
throw die(MessageFormat.format(CLIText.get().notAValidRefName, dst));
+ }
RefRename r = db.renameRef(src, dst);
- if (r.rename() != Result.RENAMED)
+ if (r.rename() != Result.RENAMED) {
throw die(MessageFormat.format(CLIText.get().cannotBeRenamed, src));
+ }
} else if (createForce || branch != null) {
String newHead = branch;