mirror of
https://fastgit.cc/github.com/sourcegit-scm/sourcegit
synced 2026-04-25 11:24:02 +08:00
- Remove all synchronous method in commands - `Command.ReadToEndAsync` now is protected method - Rename `ResultAsync` to `GetResultAsync` - Call `ConfigureAwait(false)` when there's no context Signed-off-by: leo <longshuang@msn.cn>
21 lines
552 B
C#
21 lines
552 B
C#
using System.Threading.Tasks;
|
|
|
|
namespace SourceGit.Commands
|
|
{
|
|
public class QueryCommitFullMessage : Command
|
|
{
|
|
public QueryCommitFullMessage(string repo, string sha)
|
|
{
|
|
WorkingDirectory = repo;
|
|
Context = repo;
|
|
Args = $"show --no-show-signature --format=%B -s {sha}";
|
|
}
|
|
|
|
public async Task<string> GetResultAsync()
|
|
{
|
|
var rs = await ReadToEndAsync().ConfigureAwait(false);
|
|
return rs.IsSuccess ? rs.StdOut.TrimEnd() : string.Empty;
|
|
}
|
|
}
|
|
}
|