Browse Source
Since commit caa362f20d
(Check for write errors in standard out and
exit with error, 2012-09-14), running "jgit diff" results in a
NullPointerException:
| $ jgit diff
| java.lang.NullPointerException
| at java.io.BufferedOutputStream.flushBuffer(BufferedOutputStream.java:82)
| at java.io.BufferedOutputStream.write(BufferedOutputStream.java:126)
| at org.eclipse.jgit.diff.DiffFormatter.format(DiffFormatter.java:688)
| at org.eclipse.jgit.diff.DiffFormatter.format(DiffFormatter.java:630)
| at org.eclipse.jgit.diff.DiffFormatter.format(DiffFormatter.java:616)
| at org.eclipse.jgit.diff.DiffFormatter.format(DiffFormatter.java:600)
| at org.eclipse.jgit.pgm.Diff.run(Diff.java:211)
| at org.eclipse.jgit.pgm.TextBuiltin.execute(TextBuiltin.java:166)
| at org.eclipse.jgit.pgm.Main.execute(Main.java:200)
| at org.eclipse.jgit.pgm.Main.run(Main.java:120)
| at org.eclipse.jgit.pgm.Main.main(Main.java:94)
That patch replaced most uses of System.out with a wrapper, with
changes like the following:
class Diff extends TextBuiltin {
private final DiffFormatter diffFmt = new DiffFormatter( //
- new BufferedOutputStream(System.out));
+ new BufferedOutputStream(outs));
outs is not set for TextBuiltin objects until init() has been run.
Moving the initialization to after the super.init() call gets
"jgit diff" and "jgit log -p" working well again.
Change-Id: I80fcf259c4fb733990bd16e52bcf94e66d820826
stable-2.2
Jonathan Nieder
12 years ago
2 changed files with 16 additions and 4 deletions
Loading…
Reference in new issue