feat: show git file mode change if exist

This commit is contained in:
Gadfly 2024-04-12 21:38:36 +08:00
parent 2d5e048797
commit a249eed1ac
No known key found for this signature in database
GPG key ID: 9128145F93CFC69C
7 changed files with 61 additions and 2 deletions

View file

@ -1,6 +1,7 @@
using System;
using System.Collections.Generic;
using System.Text.RegularExpressions;
using SourceGit.Models;
namespace SourceGit.Commands
{
@ -46,6 +47,22 @@ namespace SourceGit.Commands
protected override void OnReadline(string line)
{
if (line.StartsWith("old mode ", StringComparison.Ordinal))
{
_result.FileModeDiff ??= new FileModeDiff();
_result.FileModeDiff.Old = line.Substring(9);
return;
}
if (line.StartsWith("new mode ", StringComparison.Ordinal))
{
_result.FileModeDiff ??= new FileModeDiff();
_result.FileModeDiff.New = line.Substring(9);
return;
}
if (_result.IsBinary)
return;