Add support for parsing "diff --cc" style patches
commitf0d28143d6191a44e13eaf9c6507101d487506c4
authorShawn O. Pearce <spearce@spearce.org>
Fri, 12 Dec 2008 23:19:36 +0000 (12 15:19 -0800)
committerRobin Rosenberg <robin.rosenberg@dewire.com>
Sat, 13 Dec 2008 02:13:28 +0000 (13 03:13 +0100)
tree2668b0b972e93ed3785c98114f85c5914350a757
parentd9996907ad7bb1f4efc48f857a48e34bba3d1a08
Add support for parsing "diff --cc" style patches

Even though the diff --cc format used by Git is only meant to be
read by humans, JGit needs to be able to parse these to get the
patch metadata so it can be shown in a user interface to facilitate
code review processes.

Patches are parsed into the specialized CombinedFileHeader and
CombinedHunkHeader classes, where the old image information is
augmented with additional fields for the arbitrary number of parents
that can appear in such patches.  These cost more in terms of memory,
but "diff --cc" style patches tend to occur very infrequently as
they only occur during a merge conflict resolution.

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/testError_CcTruncatedOld.patch [new file with mode: 0644]
org.spearce.jgit.test/tst-rsrc/org/spearce/jgit/patch/testParse_CcDeleteFile.patch [new file with mode: 0644]
org.spearce.jgit.test/tst-rsrc/org/spearce/jgit/patch/testParse_CcNewFile.patch [new file with mode: 0644]
org.spearce.jgit.test/tst-rsrc/org/spearce/jgit/patch/testParse_OneFileCc.patch [new file with mode: 0644]
org.spearce.jgit.test/tst/org/spearce/jgit/patch/PatchCcErrorTest.java [new file with mode: 0644]
org.spearce.jgit.test/tst/org/spearce/jgit/patch/PatchCcTest.java [new file with mode: 0644]
org.spearce.jgit/src/org/spearce/jgit/patch/CombinedFileHeader.java [new file with mode: 0644]
org.spearce.jgit/src/org/spearce/jgit/patch/CombinedHunkHeader.java [new file with mode: 0644]
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/patch/Patch.java