Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions src/Commands/Diff.cs
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,18 @@ protected override void OnReadline(string line)
return;
}

if (line.StartsWith("deleted file mode ", StringComparison.Ordinal))
{
_result.OldMode = line.Substring(18);
return;
}

if (line.StartsWith("new file mode ", StringComparison.Ordinal))
{
_result.NewMode = line.Substring(14);
return;
}

if (_result.IsBinary)
return;

Expand Down
14 changes: 13 additions & 1 deletion src/Models/DiffResult.cs
Original file line number Diff line number Diff line change
Expand Up @@ -681,6 +681,18 @@ public class DiffResult
public TextDiff TextDiff { get; set; } = null;
public LFSDiff LFSDiff { get; set; } = null;

public string FileModeChange => string.IsNullOrEmpty(OldMode) ? string.Empty : $"{OldMode} → {NewMode}";
public string FileModeChange
{
get
{
if (string.IsNullOrEmpty(OldMode) && string.IsNullOrEmpty(NewMode))
return string.Empty;

var oldDisplay = string.IsNullOrEmpty(OldMode) ? "0" : OldMode;
var newDisplay = string.IsNullOrEmpty(NewMode) ? "0" : NewMode;

return $"{oldDisplay} → {newDisplay}";
}
}
}
}
Loading