pgm: Fix missing braces in Diff.run()

Change-Id: I326b85f49d9b2f3c753f8a38e3f65ee61ba35db3
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
This commit is contained in:
Matthias Sohn 2019-01-20 21:07:28 +01:00
parent a6212392d5
commit e2d1736e69
1 changed files with 6 additions and 4 deletions

View File

@ -184,8 +184,9 @@ protected void run() {
if (cached) { if (cached) {
if (oldTree == null) { if (oldTree == null) {
ObjectId head = db.resolve(HEAD + "^{tree}"); //$NON-NLS-1$ ObjectId head = db.resolve(HEAD + "^{tree}"); //$NON-NLS-1$
if (head == null) if (head == null) {
die(MessageFormat.format(CLIText.get().notATree, HEAD)); die(MessageFormat.format(CLIText.get().notATree, HEAD));
}
CanonicalTreeParser p = new CanonicalTreeParser(); CanonicalTreeParser p = new CanonicalTreeParser();
try (ObjectReader reader = db.newObjectReader()) { try (ObjectReader reader = db.newObjectReader()) {
p.reset(reader, head); p.reset(reader, head);
@ -196,15 +197,17 @@ protected void run() {
} else if (oldTree == null) { } else if (oldTree == null) {
oldTree = new DirCacheIterator(db.readDirCache()); oldTree = new DirCacheIterator(db.readDirCache());
newTree = new FileTreeIterator(db); newTree = new FileTreeIterator(db);
} else if (newTree == null) } else if (newTree == null) {
newTree = new FileTreeIterator(db); newTree = new FileTreeIterator(db);
}
TextProgressMonitor pm = new TextProgressMonitor(errw); TextProgressMonitor pm = new TextProgressMonitor(errw);
pm.setDelayStart(2, TimeUnit.SECONDS); pm.setDelayStart(2, TimeUnit.SECONDS);
diffFmt.setProgressMonitor(pm); diffFmt.setProgressMonitor(pm);
diffFmt.setPathFilter(pathFilter); diffFmt.setPathFilter(pathFilter);
if (detectRenames != null) if (detectRenames != null) {
diffFmt.setDetectRenames(detectRenames.booleanValue()); diffFmt.setDetectRenames(detectRenames.booleanValue());
}
if (renameLimit != null && diffFmt.isDetectRenames()) { if (renameLimit != null && diffFmt.isDetectRenames()) {
RenameDetector rd = diffFmt.getRenameDetector(); RenameDetector rd = diffFmt.getRenameDetector();
rd.setRenameLimit(renameLimit.intValue()); rd.setRenameLimit(renameLimit.intValue());
@ -213,7 +216,6 @@ protected void run() {
if (showNameAndStatusOnly) { if (showNameAndStatusOnly) {
nameStatus(outw, diffFmt.scan(oldTree, newTree)); nameStatus(outw, diffFmt.scan(oldTree, newTree));
outw.flush(); outw.flush();
} else { } else {
diffFmt.format(oldTree, newTree); diffFmt.format(oldTree, newTree);
diffFmt.flush(); diffFmt.flush();