mirror of
https://fastgit.cc/github.com/sourcegit-scm/sourcegit
synced 2026-04-23 02:12:25 +08:00
27 lines
711 B
C#
27 lines
711 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 string GetResult()
|
|
{
|
|
var rs = ReadToEnd();
|
|
return rs.IsSuccess ? rs.StdOut.TrimEnd() : string.Empty;
|
|
}
|
|
|
|
public async Task<string> GetResultAsync()
|
|
{
|
|
var rs = await ReadToEndAsync().ConfigureAwait(false);
|
|
return rs.IsSuccess ? rs.StdOut.TrimEnd() : string.Empty;
|
|
}
|
|
}
|
|
}
|