Top Description Fields Constructors Methods
org.eclipse.jgit.patch

public Class CombinedFileHeader

extends FileHeader
Class Inheritance
Static Imports
org.eclipse.jgit.lib.Constants.encodeASCII, org.eclipse.jgit.util.RawParseUtils.match, .RawParseUtils.nextLF

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.

Field Summary

Modifier and TypeField and Description
private static final byte[]
private AbbreviatedObjectId[]
private FileMode[]
Inherited from org.eclipse.jgit.patch.FileHeader:
bufDELETED_FILE_MODEendOffsetforwardBinaryHunkINDEXNEW_FILE_MODENEW_NAMEOLD_NAMEpatchTypereverseBinaryHunkstartOffset

Constructor Summary

AccessConstructor and Description
pack-priv
CombinedFileHeader(byte[] b, int offset)

Method Summary

Modifier and TypeMethod and Description
public List<? extends CombinedHunkHeader>
getHunks()

Overrides org.eclipse.jgit.patch.FileHeader.getHunks.

Get hunks altering this file; in order of appearance in patch

public AbbreviatedObjectId

Returns:

get the object id of the first parent.
getOldId
()

Overrides org.eclipse.jgit.diff.DiffEntry.getOldId.

Get the old object id from the index.

public AbbreviatedObjectId

Returns:

the id of the requested ancestor.
getOldId
(int
the ancestor to get the object id of
nthParent
)

Get the ObjectId of the nth ancestor

public FileMode

Returns:

get the file mode of the first parent.
getOldMode
()

Overrides org.eclipse.jgit.diff.DiffEntry.getOldMode.

Get the old file mode

public FileMode

Returns:

the mode of the requested ancestor.
getOldMode
(int
the ancestor to get the mode of
nthParent
)

Get the file mode of the nth ancestor

public int

Returns:

number of ancestor revisions mentioned in this diff.
getParentCount
()

Overrides org.eclipse.jgit.patch.FileHeader.getParentCount.

public String
getScriptText(Charset
hint character set to decode the old lines with.
ocs
,
Charset
hint character set to decode the new lines with.
ncs
)

Overrides org.eclipse.jgit.patch.FileHeader.getScriptText.

Convert the patch script for this file into a string.

public String
getScriptText(Charset[]
hint which charset is used
charsetGuess
)

Overrides org.eclipse.jgit.patch.FileHeader.getScriptText.

Convert the patch script for this file into a string.

pack-priv HunkHeader
private void
parseDeletedFileMode(int ptr, int eol)

pack-priv int
protected void
private void
parseModeLine(int ptr, int eol)

protected void
Inherited from org.eclipse.jgit.patch.FileHeader:
addHunkgetBuffergetEndOffsetgetForwardBinaryHunkgetPatchTypegetReverseBinaryHunkgetScriptTextgetStartOffsethasMetaDataChangesisHunkHdrparseFileModeparseGitFileNameparseNewNameparseOldNameparseTraditionalHeaderstoEditList

Field Detail

MODEback to summary
private static final byte[] MODE
oldIdsback to summary
private AbbreviatedObjectId[] oldIds
oldModesback to summary
private FileMode[] oldModes

Constructor Detail

CombinedFileHeaderback to summary
pack-priv CombinedFileHeader(byte[] b, int offset)

Method Detail

getHunksback to summary
public List<? extends CombinedHunkHeader> getHunks()

Overrides org.eclipse.jgit.patch.FileHeader.getHunks.

Doc from org.eclipse.jgit.patch.FileHeader.getHunks.

Get hunks altering this file; in order of appearance in patch

Returns:List<? extends CombinedHunkHeader>

hunks altering this file; in order of appearance in patch.

Annotations
@Override
@SuppressWarnings:unchecked
getOldIdback to summary
public AbbreviatedObjectId getOldId()

Overrides org.eclipse.jgit.diff.DiffEntry.getOldId.

Doc from org.eclipse.jgit.diff.DiffEntry.getOldId.

Get the old object id from the index.

Returns:AbbreviatedObjectId

get the object id of the first parent.

Annotations
@Override
getOldIdback to summary
public AbbreviatedObjectId getOldId(int nthParent)

Get the ObjectId of the nth ancestor

Parameters
nthParent:int

the ancestor to get the object id of

Returns:AbbreviatedObjectId

the id of the requested ancestor.

getOldModeback to summary
public FileMode getOldMode()

Overrides org.eclipse.jgit.diff.DiffEntry.getOldMode.

Doc from org.eclipse.jgit.diff.DiffEntry.getOldMode.

Get the old file mode

Returns:FileMode

get the file mode of the first parent.

Annotations
@Override
getOldModeback to summary
public FileMode getOldMode(int nthParent)

Get the file mode of the nth ancestor

Parameters
nthParent:int

the ancestor to get the mode of

Returns:FileMode

the mode of the requested ancestor.

getParentCountback to summary
public int getParentCount()

Overrides org.eclipse.jgit.patch.FileHeader.getParentCount.

Returns:int

number of ancestor revisions mentioned in this diff.

Annotations
@Override
getScriptTextback to summary
public String getScriptText(Charset ocs, Charset ncs)

Overrides org.eclipse.jgit.patch.FileHeader.getScriptText.

Doc from org.eclipse.jgit.patch.FileHeader.getScriptText.

Convert the patch script for this file into a string.

Parameters
ocs:Charset

hint character set to decode the old lines with.

ncs:Charset

hint character set to decode the new lines with.

Returns:String

the patch script, as a Unicode string.

Annotations
@Override
getScriptTextback to summary
public String getScriptText(Charset[] charsetGuess)

Overrides org.eclipse.jgit.patch.FileHeader.getScriptText.

Doc from org.eclipse.jgit.patch.FileHeader.getScriptText.

Convert the patch script for this file into a string.

Parameters
charsetGuess:Charset[]

hint which charset is used

Returns:String

the patch script, as a Unicode string.

Annotations
@Override
newHunkHeaderback to summary
pack-priv HunkHeader newHunkHeader(int offset)

Overrides org.eclipse.jgit.patch.FileHeader.newHunkHeader.

Annotations
@Override
parseDeletedFileModeback to summary
private void parseDeletedFileMode(int ptr, int eol)
parseGitHeadersback to summary
pack-priv int parseGitHeaders(int ptr, int end)

Overrides org.eclipse.jgit.patch.FileHeader.parseGitHeaders.

Annotations
@Override
parseIndexLineback to summary
protected void parseIndexLine(int ptr, int eol)

Overrides org.eclipse.jgit.patch.FileHeader.parseIndexLine.

Annotations
@Override
parseModeLineback to summary
private void parseModeLine(int ptr, int eol)
parseNewFileModeback to summary
protected void parseNewFileMode(int ptr, int eol)

Overrides org.eclipse.jgit.patch.FileHeader.parseNewFileMode.

Annotations
@Override