Browse Source

pgm: Fix missing braces in DiffTree.run()

Change-Id: Ic75c7e77516ff1c26803e010bf2bdbaf3e9d6ce1
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
stable-5.4
Matthias Sohn 6 years ago
parent
commit
8264135d7c
  1. 13
      org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/DiffTree.java

13
org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/DiffTree.java

@ -84,13 +84,15 @@ class DiffTree extends TextBuiltin {
final int nTree = walk.getTreeCount(); final int nTree = walk.getTreeCount();
while (walk.next()) { while (walk.next()) {
for (int i = 1; i < nTree; i++) for (int i = 1; i < nTree; i++) {
outw.print(':'); outw.print(':');
}
for (int i = 0; i < nTree; i++) { for (int i = 0; i < nTree; i++) {
final FileMode m = walk.getFileMode(i); final FileMode m = walk.getFileMode(i);
final String s = m.toString(); final String s = m.toString();
for (int pad = 6 - s.length(); pad > 0; pad--) for (int pad = 6 - s.length(); pad > 0; pad--) {
outw.print('0'); outw.print('0');
}
outw.print(s); outw.print(s);
outw.print(' '); outw.print(' ');
} }
@ -104,13 +106,14 @@ class DiffTree extends TextBuiltin {
if (nTree == 2) { if (nTree == 2) {
final int m0 = walk.getRawMode(0); final int m0 = walk.getRawMode(0);
final int m1 = walk.getRawMode(1); final int m1 = walk.getRawMode(1);
if (m0 == 0 && m1 != 0) if (m0 == 0 && m1 != 0) {
chg = 'A'; chg = 'A';
else if (m0 != 0 && m1 == 0) } else if (m0 != 0 && m1 == 0) {
chg = 'D'; chg = 'D';
else if (m0 != m1 && walk.idEqual(0, 1)) } else if (m0 != m1 && walk.idEqual(0, 1)) {
chg = 'T'; chg = 'T';
} }
}
outw.print(chg); outw.print(chg);
outw.print('\t'); outw.print('\t');

Loading…
Cancel
Save