mirror of
https://github.com/sourcegit-scm/sourcegit.git
synced 2024-12-24 20:57:19 -08:00
15 lines
446 B
C#
15 lines
446 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();
|
|
}
|
|
}
|
|
}
|