mirror of
https://github.com/sourcegit-scm/sourcegit
synced 2025-05-22 12:45:00 +00:00
enhance: show git errors when failed to get the repository root dir of given path (#397)
This commit is contained in:
parent
963916219f
commit
b16d267c9b
14 changed files with 40 additions and 39 deletions
|
@ -279,14 +279,14 @@ namespace SourceGit.Views
|
|||
return;
|
||||
}
|
||||
|
||||
var root = new Commands.QueryRepositoryRootPath(path).Result();
|
||||
if (string.IsNullOrEmpty(root))
|
||||
var test = new Commands.QueryRepositoryRootPath(path).ReadToEnd();
|
||||
if (!test.IsSuccess || string.IsNullOrEmpty(test.StdOut))
|
||||
{
|
||||
ViewModels.Welcome.Instance.InitRepository(path, parent);
|
||||
ViewModels.Welcome.Instance.InitRepository(path, parent, test.StdErr);
|
||||
return;
|
||||
}
|
||||
|
||||
var normalizedPath = root.Replace("\\", "/");
|
||||
var normalizedPath = test.StdOut.Trim().Replace("\\", "/");
|
||||
var node = ViewModels.Preference.Instance.FindOrAddNodeByRepositoryPath(normalizedPath, parent, true);
|
||||
ViewModels.Welcome.Instance.Refresh();
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue