]> source.dussan.org Git - jgit.git/commit
Allow commandline tests to use raw output 46/8746/2
authorJonathan Nieder <jrn@google.com>
Fri, 16 Nov 2012 23:16:18 +0000 (15:16 -0800)
committerJonathan Nieder <jrn@google.com>
Fri, 16 Nov 2012 23:45:52 +0000 (15:45 -0800)
commit789ca39adeb794ee63c7e5b6484f521de5b1f29d
tree076f3fe46ba671e8101f1607d5be7dde19d1e2b6
parentfa5231191d530afb24810080e89990913c8e8054
Allow commandline tests to use raw output

Introduce a new CLIGitCommand.rawExecute() helper that behaves
just like execute() except that instead of processing its output
it returns it raw.

So now you can do

final byte[] expect = { 0, 1, 2, 3 };
final byte[] actual = CLIGitCommand.rawExecute(
"git show HEAD:goo.raw", db);
assertArrayEquals(expect, actual);

to test the output from "git show HEAD:goo.raw" without being
distracted by encoding issues.

Noticed while writing tests for a new "jgit archive" command that
writes its output in ZIP format.

Change-Id: I2fe6020a537975d0ccf414b7125d85d6cd86898c
org.eclipse.jgit.pgm.test/src/org/eclipse/jgit/pgm/CLIGitCommand.java