mirror of
https://fastgit.cc/github.com/sourcegit-scm/sourcegit
synced 2026-04-26 03:40:45 +08:00
22 lines
512 B
C#
22 lines
512 B
C#
namespace SourceGit.Commands
|
|
{
|
|
public class QueryRevisionByRefName : Command
|
|
{
|
|
public QueryRevisionByRefName(string repo, string refname)
|
|
{
|
|
WorkingDirectory = repo;
|
|
Context = repo;
|
|
Args = $"rev-parse {refname}";
|
|
}
|
|
|
|
public string Result()
|
|
{
|
|
var rs = ReadToEnd();
|
|
if (rs.IsSuccess && !string.IsNullOrEmpty(rs.StdOut))
|
|
return rs.StdOut.Trim();
|
|
|
|
return null;
|
|
}
|
|
}
|
|
}
|