code_style: remove unnecessary namespace using

Signed-off-by: leo <longshuang@msn.cn>
This commit is contained in:
leo 2025-06-18 14:27:39 +08:00
parent 3ac803d88c
commit 2d91fed05e
No known key found for this signature in database

View file

@ -19,7 +19,7 @@ namespace SourceGit.Commands
if (!rs.IsSuccess) if (!rs.IsSuccess)
return outs; return outs;
var items = rs.StdOut.Split('\0', System.StringSplitOptions.RemoveEmptyEntries); var items = rs.StdOut.Split('\0', StringSplitOptions.RemoveEmptyEntries);
foreach (var item in items) foreach (var item in items)
{ {
var current = new Models.Stash(); var current = new Models.Stash();
@ -37,7 +37,8 @@ namespace SourceGit.Commands
current.SHA = line; current.SHA = line;
break; break;
case 1: case 1:
ParseParent(line, ref current); if (line.Length > 6)
current.Parents.AddRange(line.Split(' ', StringSplitOptions.RemoveEmptyEntries));
break; break;
case 2: case 2:
current.Time = ulong.Parse(line); current.Time = ulong.Parse(line);
@ -63,13 +64,5 @@ namespace SourceGit.Commands
} }
return outs; return outs;
} }
private void ParseParent(string data, ref Models.Stash current)
{
if (data.Length < 8)
return;
current.Parents.AddRange(data.Split(separator: ' ', options: StringSplitOptions.RemoveEmptyEntries));
}
} }
} }