Browse Source

pgm: Fix missing braces in Reset.run()

Change-Id: I1e854ab81063601eb4ff159aabc559cb65ce6ece
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
stable-5.4
Matthias Sohn 6 years ago
parent
commit
7cee790173
  1. 15
      org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Reset.java

15
org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Reset.java

@ -80,18 +80,23 @@ class Reset extends TextBuiltin {
ResetCommand command = git.reset();
command.setRef(commit);
if (paths.size() > 0) {
for (String path : paths)
for (String path : paths) {
command.addPath(path);
}
} else {
ResetType mode = null;
if (soft)
if (soft) {
mode = selectMode(mode, ResetType.SOFT);
if (mixed)
}
if (mixed) {
mode = selectMode(mode, ResetType.MIXED);
if (hard)
}
if (hard) {
mode = selectMode(mode, ResetType.HARD);
if (mode == null)
}
if (mode == null) {
throw die("no reset mode set"); //$NON-NLS-1$
}
command.setMode(mode);
}
command.call();

Loading…
Cancel
Save