summaryrefslogtreecommitdiffstats
path: root/org.eclipse.jgit.pgm/src/org
diff options
context:
space:
mode:
authorDavid Pursehouse <david.pursehouse@sonymobile.com>2016-02-02 18:25:55 +0900
committerDavid Pursehouse <david.pursehouse@sonymobile.com>2016-02-02 18:25:55 +0900
commit2fab7f20a7faeb9a08f352d7f6014c9a9c5ac5ab (patch)
tree6d4ef07456a2fef9a9ca550c6d95e41c8f96b8f5 /org.eclipse.jgit.pgm/src/org
parentd4ddb6fc2b2402aa78520bcffce6dc784c5c27bd (diff)
downloadjgit-2fab7f20a7faeb9a08f352d7f6014c9a9c5ac5ab.tar.gz
jgit-2fab7f20a7faeb9a08f352d7f6014c9a9c5ac5ab.zip
Branch: Fix variable hiding warning
The Branch class has a member named 'branch', which was being hidden by the local variable of the same name used in a for-loop. Change-Id: I334092010a9c80686fb79713852d4bfa166ce12f Signed-off-by: David Pursehouse <david.pursehouse@sonymobile.com>
Diffstat (limited to 'org.eclipse.jgit.pgm/src/org')
-rw-r--r--org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Branch.java16
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));
}
}
}