code_style: move protected methods together

Signed-off-by: leo <longshuang@msn.cn>
This commit is contained in:
leo
2025-08-13 11:14:41 +08:00
parent 33de0fe219
commit 5b6450d026

View File

@@ -50,28 +50,6 @@ namespace SourceGit.Commands
}
}
protected Result ReadToEnd()
{
using var proc = new Process() { StartInfo = CreateGitStartInfo(true) };
try
{
proc.Start();
}
catch (Exception e)
{
return Result.Failed(e.Message);
}
var rs = new Result() { IsSuccess = true };
rs.StdOut = proc.StandardOutput.ReadToEnd();
rs.StdErr = proc.StandardError.ReadToEnd();
proc.WaitForExit();
rs.IsSuccess = proc.ExitCode == 0;
return rs;
}
public async Task<bool> ExecAsync()
{
Log?.AppendLine($"$ git {Args}\n");
@@ -149,6 +127,28 @@ namespace SourceGit.Commands
return true;
}
protected Result ReadToEnd()
{
using var proc = new Process() { StartInfo = CreateGitStartInfo(true) };
try
{
proc.Start();
}
catch (Exception e)
{
return Result.Failed(e.Message);
}
var rs = new Result() { IsSuccess = true };
rs.StdOut = proc.StandardOutput.ReadToEnd();
rs.StdErr = proc.StandardError.ReadToEnd();
proc.WaitForExit();
rs.IsSuccess = proc.ExitCode == 0;
return rs;
}
protected async Task<Result> ReadToEndAsync()
{
using var proc = new Process() { StartInfo = CreateGitStartInfo(true) };