enhance: show git errors when failed to get the repository root dir of given path (#397)

This commit is contained in:
leo 2024-08-27 15:35:10 +08:00
parent 963916219f
commit b16d267c9b
No known key found for this signature in database
14 changed files with 40 additions and 39 deletions

View file

@ -10,11 +10,18 @@ namespace SourceGit.ViewModels
set => SetProperty(ref _targetPath, value);
}
public Init(string path, RepositoryNode parent)
public string Reason
{
get;
private set;
}
public Init(string path, RepositoryNode parent, string reason)
{
_targetPath = path;
_parentNode = parent;
Reason = string.IsNullOrEmpty(reason) ? "Invalid repository detected!" : reason;
View = new Views.Init() { DataContext = this };
}