mirror of
https://fastgit.cc/github.com/sourcegit-scm/sourcegit
synced 2026-04-21 05:10:25 +08:00
21 lines
482 B
C#
21 lines
482 B
C#
namespace SourceGit.Commands
|
|
{
|
|
public class QueryRepositoryRootPath : Command
|
|
{
|
|
public QueryRepositoryRootPath(string path)
|
|
{
|
|
WorkingDirectory = path;
|
|
Args = "rev-parse --show-toplevel";
|
|
RaiseError = false;
|
|
}
|
|
|
|
public string Result()
|
|
{
|
|
var rs = ReadToEnd().StdOut;
|
|
if (string.IsNullOrEmpty(rs))
|
|
return null;
|
|
return rs.Trim();
|
|
}
|
|
}
|
|
}
|