Skip to content

Commit 5b6450d

Browse files
committed
code_style: move protected methods together
Signed-off-by: leo <[email protected]>
1 parent 33de0fe commit 5b6450d

File tree

1 file changed

+22
-22
lines changed

1 file changed

+22
-22
lines changed

src/Commands/Command.cs

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -50,28 +50,6 @@ public void Exec()
5050
}
5151
}
5252

53-
protected Result ReadToEnd()
54-
{
55-
using var proc = new Process() { StartInfo = CreateGitStartInfo(true) };
56-
57-
try
58-
{
59-
proc.Start();
60-
}
61-
catch (Exception e)
62-
{
63-
return Result.Failed(e.Message);
64-
}
65-
66-
var rs = new Result() { IsSuccess = true };
67-
rs.StdOut = proc.StandardOutput.ReadToEnd();
68-
rs.StdErr = proc.StandardError.ReadToEnd();
69-
proc.WaitForExit();
70-
71-
rs.IsSuccess = proc.ExitCode == 0;
72-
return rs;
73-
}
74-
7553
public async Task<bool> ExecAsync()
7654
{
7755
Log?.AppendLine($"$ git {Args}\n");
@@ -149,6 +127,28 @@ public async Task<bool> ExecAsync()
149127
return true;
150128
}
151129

130+
protected Result ReadToEnd()
131+
{
132+
using var proc = new Process() { StartInfo = CreateGitStartInfo(true) };
133+
134+
try
135+
{
136+
proc.Start();
137+
}
138+
catch (Exception e)
139+
{
140+
return Result.Failed(e.Message);
141+
}
142+
143+
var rs = new Result() { IsSuccess = true };
144+
rs.StdOut = proc.StandardOutput.ReadToEnd();
145+
rs.StdErr = proc.StandardError.ReadToEnd();
146+
proc.WaitForExit();
147+
148+
rs.IsSuccess = proc.ExitCode == 0;
149+
return rs;
150+
}
151+
152152
protected async Task<Result> ReadToEndAsync()
153153
{
154154
using var proc = new Process() { StartInfo = CreateGitStartInfo(true) };

0 commit comments

Comments
 (0)