mirror of
https://fastgit.cc/github.com/sourcegit-scm/sourcegit
synced 2026-04-30 13:51:53 +08:00
refactor<*>: rewrite all with AvaloniaUI
This commit is contained in:
15
src/Commands/QueryRepositoryRootPath.cs
Normal file
15
src/Commands/QueryRepositoryRootPath.cs
Normal file
@@ -0,0 +1,15 @@
|
||||
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();
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user