enhance: Handle file mode changes for new/deleted file (#1040)

This commit is contained in:
GadflyFang 2025-03-03 10:38:58 +08:00 committed by GitHub
parent 4c63c4c90d
commit 7f8372f6b5
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 25 additions and 1 deletions

View file

@ -68,6 +68,18 @@ namespace SourceGit.Commands
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;