Add getScriptText functions to obtain the plain-text version of a patch
commitf2f1503d516943655a4f0641aa11bf57b34c584a
authorShawn O. Pearce <spearce@spearce.org>
Wed, 17 Dec 2008 20:09:22 +0000 (17 12:09 -0800)
committerRobin Rosenberg <robin.rosenberg@dewire.com>
Wed, 17 Dec 2008 23:29:07 +0000 (18 00:29 +0100)
treec72f72b3614a9fd0a870f0ba36d5b968556272db
parentc88e657290b434b90acdaa946ad6d61ffd1e139b
Add getScriptText functions to obtain the plain-text version of a patch

The conversion from byte[] to String is performed one file at a time,
in case the patch is a character encoding conversion patch for the
file.  For simplicity we currently assume UTF-8 still as the default
encoding for any content, but eventually we should support using the
.gitattributes encoding property when performing this conversion.

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Robin Rosenberg <robin.rosenberg@dewire.com>
org.spearce.jgit.test/tst-rsrc/org/spearce/jgit/patch/testGetText_BothISO88591.patch [new file with mode: 0644]
org.spearce.jgit.test/tst-rsrc/org/spearce/jgit/patch/testGetText_Convert.patch [new file with mode: 0644]
org.spearce.jgit.test/tst-rsrc/org/spearce/jgit/patch/testGetText_DiffCc.patch [new file with mode: 0644]
org.spearce.jgit.test/tst-rsrc/org/spearce/jgit/patch/testGetText_NoBinary.patch [new file with mode: 0644]
org.spearce.jgit.test/tst/org/spearce/jgit/patch/GetTextTest.java [new file with mode: 0644]
org.spearce.jgit/src/org/spearce/jgit/patch/CombinedFileHeader.java
org.spearce.jgit/src/org/spearce/jgit/patch/CombinedHunkHeader.java
org.spearce.jgit/src/org/spearce/jgit/patch/FileHeader.java
org.spearce.jgit/src/org/spearce/jgit/patch/HunkHeader.java
org.spearce.jgit/src/org/spearce/jgit/util/RawParseUtils.java