summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthias Sohn <matthias.sohn@sap.com>2019-01-20 21:37:38 +0100
committerMatthias Sohn <matthias.sohn@sap.com>2019-01-21 00:54:15 +0100
commit0eb0d6c58f62727a15fde1781db7198caabe5ad6 (patch)
tree1c6032f45175ef3988cf10224f20f8ccd486f4c2
parenta19ad89d990777990c9e422ca478ff0b314cd5fa (diff)
downloadjgit-0eb0d6c58f62727a15fde1781db7198caabe5ad6.tar.gz
jgit-0eb0d6c58f62727a15fde1781db7198caabe5ad6.zip
pgm: Fix missing braces in LsTree.run()
Change-Id: Iac1755c2ec8094cd211bbc9f1d819cc8052e20cb Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
-rw-r--r--org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/LsTree.java6
1 files changed, 4 insertions, 2 deletions
diff --git a/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/LsTree.java b/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/LsTree.java
index d2bf9ac187..2a2bb7cc91 100644
--- a/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/LsTree.java
+++ b/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()));