UnifiedDiffHunk Class
A hunk of a unified diff: a group of changes with their lines of context, introduced by an @@ line.
public sealed class UnifiedDiffHunkProperties
| Name | Description |
|---|---|
| Lines | Gets the lines of the hunk, in order. |
| NewLineCount | Gets the number of lines of the new text that the hunk covers: its context and inserted lines. |
| NewStart | Gets the 1-based number of the first line of the hunk in the new text. When UnifiedDiffHunk.NewLineCount is 0, it is the number of the line after which the lines were deleted. |
| OldLineCount | Gets the number of lines of the old text that the hunk covers: its context and deleted lines. |
| OldStart | Gets the 1-based number of the first line of the hunk in the old text. When UnifiedDiffHunk.OldLineCount is 0, it is the number of the line after which the lines are inserted, and 0 inserts them at the start of the text. |
| SectionHeading | Gets the text written after the closing @@, such as the name of the function git diff writes, or null when there is none. |
Lines
UnifiedDiffHunk.csGets the lines of the hunk, in order.
public IReadOnlyList<UnifiedDiffLine> Lines { get; }Property value
NewLineCount
UnifiedDiffHunk.csNewStart
UnifiedDiffHunk.csGets the 1-based number of the first line of the hunk in the new text. When UnifiedDiffHunk.NewLineCount is 0, it is the number of the line after which the lines were deleted.
public int NewStart { get; }Property value
OldLineCount
UnifiedDiffHunk.csOldStart
UnifiedDiffHunk.csGets the 1-based number of the first line of the hunk in the old text. When UnifiedDiffHunk.OldLineCount is 0, it is the number of the line after which the lines are inserted, and 0 inserts them at the start of the text.
public int OldStart { get; }Property value
SectionHeading
UnifiedDiffHunk.csMethods
| Name | Description |
|---|---|
| ToString() | Returns the hunk in the unified format: its @@ line followed by its lines. |