mirror of
https://github.com/sourcegit-scm/sourcegit
synced 2025-05-22 04:34:59 +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
|
@ -35,8 +35,8 @@ namespace SourceGit.ViewModels
|
|||
var pref = Preference.Instance;
|
||||
if (!string.IsNullOrEmpty(startupRepo))
|
||||
{
|
||||
var root = new Commands.QueryRepositoryRootPath(startupRepo).Result();
|
||||
if (string.IsNullOrEmpty(root))
|
||||
var test = new Commands.QueryRepositoryRootPath(startupRepo).ReadToEnd();
|
||||
if (!test.IsSuccess || string.IsNullOrEmpty(test.StdOut))
|
||||
{
|
||||
Pages[0].Notifications.Add(new Models.Notification
|
||||
{
|
||||
|
@ -46,7 +46,7 @@ namespace SourceGit.ViewModels
|
|||
return;
|
||||
}
|
||||
|
||||
var normalized = root.Replace("\\", "/");
|
||||
var normalized = test.StdOut.Trim().Replace("\\", "/");
|
||||
var node = pref.FindOrAddNodeByRepositoryPath(normalized, null, false);
|
||||
Welcome.Instance.Refresh();
|
||||
OpenRepositoryInTab(node, null);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue