mirror of
https://github.com/sourcegit-scm/sourcegit
synced 2025-05-22 04:34:59 +00:00
19 lines
No EOL
465 B
C#
19 lines
No EOL
465 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();
|
|
}
|
|
}
|
|
} |