File tree Expand file tree Collapse file tree 2 files changed +25
-1
lines changed Expand file tree Collapse file tree 2 files changed +25
-1
lines changed Original file line number Diff line number Diff line change @@ -68,6 +68,18 @@ protected override void OnReadline(string line)
6868 return ;
6969 }
7070
71+ if ( line . StartsWith ( "deleted file mode " , StringComparison . Ordinal ) )
72+ {
73+ _result . OldMode = line . Substring ( 18 ) ;
74+ return ;
75+ }
76+
77+ if ( line . StartsWith ( "new file mode " , StringComparison . Ordinal ) )
78+ {
79+ _result . NewMode = line . Substring ( 14 ) ;
80+ return ;
81+ }
82+
7183 if ( _result . IsBinary )
7284 return ;
7385
Original file line number Diff line number Diff line change @@ -681,6 +681,18 @@ public class DiffResult
681681 public TextDiff TextDiff { get ; set ; } = null ;
682682 public LFSDiff LFSDiff { get ; set ; } = null ;
683683
684- public string FileModeChange => string . IsNullOrEmpty ( OldMode ) ? string . Empty : $ "{ OldMode } → { NewMode } ";
684+ public string FileModeChange
685+ {
686+ get
687+ {
688+ if ( string . IsNullOrEmpty ( OldMode ) && string . IsNullOrEmpty ( NewMode ) )
689+ return string . Empty ;
690+
691+ var oldDisplay = string . IsNullOrEmpty ( OldMode ) ? "0" : OldMode ;
692+ var newDisplay = string . IsNullOrEmpty ( NewMode ) ? "0" : NewMode ;
693+
694+ return $ "{ oldDisplay } → { newDisplay } ";
695+ }
696+ }
685697 }
686698}
You can’t perform that action at this time.
0 commit comments