本文整理匯總了Java中org.eclipse.jgit.patch.FileHeader.PatchType類的典型用法代碼示例。如果您正苦於以下問題:Java PatchType類的具體用法?Java PatchType怎麽用?Java PatchType使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
PatchType類屬於org.eclipse.jgit.patch.FileHeader包,在下文中一共展示了PatchType類的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: format
import org.eclipse.jgit.patch.FileHeader.PatchType; //導入依賴的package包/類
@Override
public void format(FileHeader hdr, RawText a, RawText b)
throws IOException {
int start = hdr.getStartOffset();
int end = hdr.getEndOffset();
if (!hdr.getHunks().isEmpty()) {
end = hdr.getHunks().get(0).getStartOffset();
}
renderHeader(RawParseUtils.decode(hdr.getBuffer(), start, end));
if (hdr.getPatchType() == PatchType.UNIFIED) {
getOutputStream().write(DIFF_BEGIN);
format(hdr.toEditList(), a, b);
getOutputStream().write(DIFF_END);
}
}
示例2: createPatchListEntry
import org.eclipse.jgit.patch.FileHeader.PatchType; //導入依賴的package包/類
private static PatchListEntry createPatchListEntry(
RawTextComparator cmp, RevCommit aCommit, Text aText, Text bText, String fileName) {
byte[] rawHdr = getRawHeader(aCommit != null, fileName);
byte[] aContent = aText.getContent();
byte[] bContent = bText.getContent();
long size = bContent.length;
long sizeDelta = bContent.length - aContent.length;
RawText aRawText = new RawText(aContent);
RawText bRawText = new RawText(bContent);
EditList edits = new HistogramDiff().diff(cmp, aRawText, bRawText);
FileHeader fh = new FileHeader(rawHdr, edits, PatchType.UNIFIED);
return new PatchListEntry(fh, edits, ImmutableSet.of(), size, sizeDelta);
}
示例3: newEntry
import org.eclipse.jgit.patch.FileHeader.PatchType; //導入依賴的package包/類
private static PatchListEntry newEntry(
RevTree aTree, FileHeader fileHeader, Set<Edit> editsDueToRebase, long size, long sizeDelta) {
if (aTree == null // want combined diff
|| fileHeader.getPatchType() != PatchType.UNIFIED
|| fileHeader.getHunks().isEmpty()) {
return new PatchListEntry(fileHeader, ImmutableList.of(), ImmutableSet.of(), size, sizeDelta);
}
List<Edit> edits = fileHeader.toEditList();
if (edits.isEmpty()) {
return new PatchListEntry(fileHeader, ImmutableList.of(), ImmutableSet.of(), size, sizeDelta);
}
return new PatchListEntry(fileHeader, edits, editsDueToRebase, size, sizeDelta);
}