1- using LibGit2Sharp . Core ;
2- using LibGit2Sharp . Core . Handles ;
31using System ;
42using System . Collections ;
53using System . Collections . Generic ;
64using System . Diagnostics ;
75using System . Globalization ;
86using System . Text ;
7+ using LibGit2Sharp . Core ;
8+ using LibGit2Sharp . Core . Handles ;
99
1010namespace LibGit2Sharp
1111{
@@ -68,11 +68,6 @@ private unsafe int PrintCallBack(git_diff_delta* delta, GitDiffHunk hunk, GitDif
6868 PatchEntryChanges currentChange = this [ filePath ] ;
6969 string prefix = string . Empty ;
7070
71- string decodedContent = LaxUtf8Marshaler . FromNative ( line . content , ( int ) line . contentLen ) ;
72-
73- currentChange . AddedLines = currentChange . AddedLines ?? new List < Line > ( ) ;
74- currentChange . DeletedLines = currentChange . DeletedLines ?? new List < Line > ( ) ;
75-
7671 switch ( line . lineOrigin )
7772 {
7873 case GitDiffLineOrigin . GIT_DIFF_LINE_CONTEXT :
@@ -82,14 +77,14 @@ private unsafe int PrintCallBack(git_diff_delta* delta, GitDiffHunk hunk, GitDif
8277 case GitDiffLineOrigin . GIT_DIFF_LINE_ADDITION :
8378 linesAdded ++ ;
8479 currentChange . LinesAdded ++ ;
85- currentChange . AddedLines . Add ( new Line ( line . NewLineNo , decodedContent ) ) ;
80+ currentChange . AddedLines . Add ( new Line ( line . NewLineNo , patchPart ) ) ;
8681 prefix = "+" ;
8782 break ;
8883
8984 case GitDiffLineOrigin . GIT_DIFF_LINE_DELETION :
9085 linesDeleted ++ ;
9186 currentChange . LinesDeleted ++ ;
92- currentChange . DeletedLines . Add ( new Line ( line . OldLineNo , decodedContent ) ) ;
87+ currentChange . DeletedLines . Add ( new Line ( line . OldLineNo , patchPart ) ) ;
9388 prefix = "-" ;
9489 break ;
9590 }
0 commit comments