]> source.dussan.org Git - jgit.git/commitdiff
pgm: Flush stderr during shutdown 07/25307/2
authorShawn Pearce <spearce@spearce.org>
Sun, 20 Apr 2014 01:02:48 +0000 (18:02 -0700)
committerShawn Pearce <spearce@spearce.org>
Mon, 21 Apr 2014 18:41:05 +0000 (11:41 -0700)
If an error occurs in command line option parsing the error message
may be stuck in a Java level buffer.  Flush the stream to ensure
everything is made available to the calling process or terminal.

Change-Id: I55b16e43aa96fc81c1197121032f5cdd901d412c

org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Main.java

index 94591393afd8eddcd113ac6d70ca34a00001ba22..ea2ef358b7de94401fa883459ef0c094d64d34f8 100644 (file)
@@ -224,6 +224,8 @@ public class Main {
                } finally {
                        if (cmd.outw != null)
                                cmd.outw.flush();
+                       if (cmd.errw != null)
+                               cmd.errw.flush();
                }
        }