mirror of
https://github.com/sourcegit-scm/sourcegit.git
synced 2024-12-23 20:47:25 -08:00
enhance: diff with LFS filtered files
This commit is contained in:
parent
63b42224f3
commit
cd2ecb109a
1 changed files with 9 additions and 11 deletions
|
@ -39,20 +39,18 @@ namespace SourceGit.Commands {
|
|||
if (_result.IsLFS) {
|
||||
var ch = line[0];
|
||||
if (ch == '-') {
|
||||
line = line.Substring(1);
|
||||
if (line.StartsWith("oid sha256:")) {
|
||||
_result.LFSDiff.Old.Oid = line.Substring(11);
|
||||
} else if (line.StartsWith("size ")) {
|
||||
_result.LFSDiff.Old.Size = long.Parse(line.Substring(5));
|
||||
if (line.StartsWith("-oid sha256:", StringComparison.Ordinal)) {
|
||||
_result.LFSDiff.Old.Oid = line.Substring(12);
|
||||
} else if (line.StartsWith("-size ", StringComparison.Ordinal)) {
|
||||
_result.LFSDiff.Old.Size = long.Parse(line.Substring(6));
|
||||
}
|
||||
} else if (ch == '+') {
|
||||
line = line.Substring(1);
|
||||
if (line.StartsWith("oid sha256:")) {
|
||||
_result.LFSDiff.New.Oid = line.Substring(11);
|
||||
} else if (line.StartsWith("size ")) {
|
||||
_result.LFSDiff.New.Size = long.Parse(line.Substring(5));
|
||||
if (line.StartsWith("+oid sha256:", StringComparison.Ordinal)) {
|
||||
_result.LFSDiff.New.Oid = line.Substring(12);
|
||||
} else if (line.StartsWith("+size ", StringComparison.Ordinal)) {
|
||||
_result.LFSDiff.New.Size = long.Parse(line.Substring(6));
|
||||
}
|
||||
} else if (line.StartsWith(" size ")) {
|
||||
} else if (line.StartsWith(" size ", StringComparison.Ordinal)) {
|
||||
_result.LFSDiff.New.Size = _result.LFSDiff.Old.Size = long.Parse(line.Substring(6));
|
||||
}
|
||||
return;
|
||||
|
|
Loading…
Reference in a new issue