Browse Source

pgm: Fix missing braces in LsTree.run()

Change-Id: Iac1755c2ec8094cd211bbc9f1d819cc8052e20cb
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
stable-5.4
Matthias Sohn 6 years ago
parent
commit
0eb0d6c58f
  1. 6
      org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/LsTree.java

6
org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/LsTree.java

@ -76,15 +76,17 @@ class LsTree extends TextBuiltin {
protected void run() {
try (TreeWalk walk = new TreeWalk(db)) {
walk.reset(); // drop the first empty tree, which we do not need here
if (paths.size() > 0)
if (paths.size() > 0) {
walk.setFilter(PathFilterGroup.createFromStrings(paths));
}
walk.setRecursive(recursive);
walk.addTree(tree);
while (walk.next()) {
final FileMode mode = walk.getFileMode(0);
if (mode == FileMode.TREE)
if (mode == FileMode.TREE) {
outw.print('0');
}
outw.print(mode);
outw.print(' ');
outw.print(Constants.typeString(mode.getObjectType()));

Loading…
Cancel
Save