diff options
author | Matthias Sohn <matthias.sohn@sap.com> | 2016-02-03 10:30:38 +0100 |
---|---|---|
committer | Matthias Sohn <matthias.sohn@sap.com> | 2016-02-03 10:30:52 +0100 |
commit | b0facdc1132e940272ef99e13c1100ccc3a70a78 (patch) | |
tree | a79475ae38a4e1e41c61f055c4ad64b40595198a /org.eclipse.jgit.pgm | |
parent | 27a6a5265465c50ec2ed76c4fcdd84bd1175779f (diff) | |
parent | 06bf69d8ca36ca81d6f1d86026c72302fdf72189 (diff) | |
download | jgit-b0facdc1132e940272ef99e13c1100ccc3a70a78.tar.gz jgit-b0facdc1132e940272ef99e13c1100ccc3a70a78.zip |
Merge branch 'stable-4.2'
* stable-4.2:
DirCacheCheckoutTest: Open Git and TreeWalk in try-with-resource
CommitCommand: Remove declaration of unthrown exception
Branch: Fix variable hiding warning
ApplyCommandTest: Open Git in try-with-resource
PackFileTest: Open ObjectInserter.Formatter in try-with-resource
Change-Id: I8484b10fad5a4c35fcfaedc1cdf8ccf97471618e
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
Diffstat (limited to 'org.eclipse.jgit.pgm')
-rw-r--r-- | org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Branch.java | 16 |
1 files changed, 8 insertions, 8 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 045f3571e5..bf6ee3a945 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 @@ -310,24 +310,24 @@ class Branch extends TextBuiltin { throws IOException { String current = db.getBranch(); ObjectId head = db.resolve(Constants.HEAD); - for (String branch : branches) { - if (branch.equals(current)) { - throw die(MessageFormat.format(CLIText.get().cannotDeleteTheBranchWhichYouAreCurrentlyOn, branch)); + for (String b : branches) { + if (b.equals(current)) { + throw die(MessageFormat.format(CLIText.get().cannotDeleteTheBranchWhichYouAreCurrentlyOn, b)); } RefUpdate update = db.updateRef((remote ? Constants.R_REMOTES : Constants.R_HEADS) - + branch); + + b); update.setNewObjectId(head); update.setForceUpdate(force || remote); Result result = update.delete(); if (result == Result.REJECTED) { - throw die(MessageFormat.format(CLIText.get().branchIsNotAnAncestorOfYourCurrentHEAD, branch)); + throw die(MessageFormat.format(CLIText.get().branchIsNotAnAncestorOfYourCurrentHEAD, b)); } else if (result == Result.NEW) - throw die(MessageFormat.format(CLIText.get().branchNotFound, branch)); + throw die(MessageFormat.format(CLIText.get().branchNotFound, b)); if (remote) - outw.println(MessageFormat.format(CLIText.get().deletedRemoteBranch, branch)); + outw.println(MessageFormat.format(CLIText.get().deletedRemoteBranch, b)); else if (verbose) - outw.println(MessageFormat.format(CLIText.get().deletedBranch, branch)); + outw.println(MessageFormat.format(CLIText.get().deletedBranch, b)); } } } |