Package org.eclipse.jgit.patch
Class CombinedFileHeader
- java.lang.Object
-
- org.eclipse.jgit.diff.DiffEntry
-
- org.eclipse.jgit.patch.FileHeader
-
- org.eclipse.jgit.patch.CombinedFileHeader
-
public class CombinedFileHeader extends FileHeader
A file in the Git "diff --cc" or "diff --combined" format.A combined diff shows an n-way comparison between two or more ancestors and the final revision. Its primary function is to perform code reviews on a merge which introduces changes not in any ancestor.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.eclipse.jgit.patch.FileHeader
FileHeader.PatchType
-
Nested classes/interfaces inherited from class org.eclipse.jgit.diff.DiffEntry
DiffEntry.ChangeType, DiffEntry.Side
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description List<? extends CombinedHunkHeader>getHunks()AbbreviatedObjectIdgetOldId()Get the old object id from theindex.AbbreviatedObjectIdgetOldId(int nthParent)Get the ObjectId of the nth ancestorFileModegetOldMode()FileModegetOldMode(int nthParent)Get the file mode of the nth ancestorintgetParentCount()StringgetScriptText(Charset[] charsetGuess)Convert the patch script for this file into a string.StringgetScriptText(Charset ocs, Charset ncs)Convert the patch script for this file into a string.protected voidparseIndexLine(int ptr, int eol)protected voidparseNewFileMode(int ptr, int eol)-
Methods inherited from class org.eclipse.jgit.patch.FileHeader
getBuffer, getEndOffset, getForwardBinaryHunk, getPatchType, getReverseBinaryHunk, getScriptText, getStartOffset, hasMetaDataChanges, toEditList
-
Methods inherited from class org.eclipse.jgit.diff.DiffEntry
getChangeType, getId, getMode, getNewId, getNewMode, getNewPath, getOldPath, getPath, getScore, getTreeFilterMarks, isMarked, scan, scan, scan, toString
-
-
-
-
Method Detail
-
getHunks
public List<? extends CombinedHunkHeader> getHunks()
- Overrides:
getHunksin classFileHeader- Returns:
- hunks altering this file; in order of appearance in patch
-
getParentCount
public int getParentCount()
- Returns:
- number of ancestor revisions mentioned in this diff.
-
getOldMode
public FileMode getOldMode()
- Overrides:
getOldModein classDiffEntry- Returns:
- get the file mode of the first parent.
-
getOldMode
public FileMode getOldMode(int nthParent)
Get the file mode of the nth ancestor- Parameters:
nthParent- the ancestor to get the mode of- Returns:
- the mode of the requested ancestor.
-
getOldId
public AbbreviatedObjectId getOldId()
Description copied from class:DiffEntryGet the old object id from theindex.
-
getOldId
public AbbreviatedObjectId getOldId(int nthParent)
Get the ObjectId of the nth ancestor- Parameters:
nthParent- the ancestor to get the object id of- Returns:
- the id of the requested ancestor.
-
getScriptText
public String getScriptText(Charset ocs, Charset ncs)
Description copied from class:FileHeaderConvert the patch script for this file into a string.- Overrides:
getScriptTextin classFileHeader- Parameters:
ocs- hint character set to decode the old lines with.ncs- hint character set to decode the new lines with.- Returns:
- the patch script, as a Unicode string.
-
getScriptText
public String getScriptText(Charset[] charsetGuess)
Convert the patch script for this file into a string.- Parameters:
charsetGuess- optional array to suggest the character set to use when decoding each file's line. If supplied the array must have a length ofrepresenting the old revision character sets and the new revision character set.getParentCount()+ 1- Returns:
- the patch script, as a Unicode string.
-
parseIndexLine
protected void parseIndexLine(int ptr, int eol)
-
parseNewFileMode
protected void parseNewFileMode(int ptr, int eol)
-
-