]> source.dussan.org Git - jgit.git/commit
Create FileHeader from DiffEntry 85/1085/5
authorJeff Schumacher <jeffschu@google.com>
Thu, 8 Jul 2010 16:59:36 +0000 (09:59 -0700)
committerJeff Schumacher <jeffschu@google.com>
Thu, 8 Jul 2010 23:58:55 +0000 (16:58 -0700)
commita8b29afd82795b3d98b42bf214fea27ab61984cc
tree68df10df1a09042f143bac43e47ddb9d1f250fd7
parent1913b41bc749ed8a176d7ea8100fb4b260547523
Create FileHeader from DiffEntry

Added support for converting DiffEntrys to FileHeaders. FileHeaders
are DiffEntrys with a buffer containing the diff output as well as
a list of HunkHeaders. The HunkHeaders contain EditLists. The
createFileHeader(DiffEntry) method in DiffFormatter performs a Myers
Diff on the files refered to by the DiffEntry, then puts the returned
EditList into a single HunkHeader, which is then put into the
FileHeader to be returned. It also generates the appropriate diff
header an puts it into the FileHeader's buffer. The rest of the diff
output, which would normally be parsed to generate the HunkHeaders,
is not generated. In fact, the purpose of this method is to avoid
the costly diff output generation and parsing normally required to
create a FileHeader.

Change-Id: I7d8b18c0f6c85e3d02ad58995d3d231e69af5887
org.eclipse.jgit.test/tst/org/eclipse/jgit/diff/DiffFormatterTest.java [new file with mode: 0644]
org.eclipse.jgit/src/org/eclipse/jgit/diff/DiffEntry.java
org.eclipse.jgit/src/org/eclipse/jgit/diff/DiffFormatter.java
org.eclipse.jgit/src/org/eclipse/jgit/patch/FileHeader.java
org.eclipse.jgit/src/org/eclipse/jgit/patch/HunkHeader.java
org.eclipse.jgit/src/org/eclipse/jgit/patch/Patch.java