8000 Added Line struct and lists for addedlines and deletedlines in conten… · wtf3505-git/libgit2sharp@79e11b9 · GitHub
[go: up one dir, main page]

Skip to content

Commit 79e11b9

Browse files
committed
Added Line struct and lists for addedlines and deletedlines in content changes
1 parent 7fc4be5 commit 79e11b9

File tree

2 files changed

+31
-0
lines changed

2 files changed

+31
-0
lines changed

LibGit2Sharp/ContentChanges.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
using System;
2+
using System.Collections.Generic;
23
using System.Diagnostics;
34
using System.Globalization;
45
using System.Text;
@@ -51,6 +52,11 @@ internal void AppendToPatch(string patch)
5152
/// </summary>
5253
public virtual int LinesDeleted { get; internal set; }
5354

55+
public IEnumerable<Line> AddedLines { get; internal set; }
56+
57+
public IEnumerable<Line> DeletedLines { get; internal set; }
58+
59+
5460
/// <summary>
5561
/// The patch corresponding to these changes.
5662
/// </summary>

LibGit2Sharp/Core/Line.cs

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
using System;
2+
using System.Collections.Generic;
3+
using System.Text;
4+
5+
namespace LibGit2Sharp.Core
6+
{
7+
internal struct Line
8+
{
9+
/// <summary>
10+
/// Points to the number of the original line in the blob
11+
/// </summary>
12+
public int LineNumber { get; }
13+
14+
/// <summary>
15+
/// This content of the line in the original blob
16+
/// </summary>
17+
public String Content { get; }
18+
19+
internal Line(int lineNumber, string content)
20+
{
21+
LineNumber = lineNumber;
22+
Content = content;
23+
}
24+
}
25+
}

0 commit comments

Comments
 (0)
0