mirror of
https://github.com/sourcegit-scm/sourcegit.git
synced 2024-12-23 20:47:25 -08:00
enhance: only load repository settings if file exists
This commit is contained in:
parent
21ec16b4cc
commit
50fe25a631
1 changed files with 10 additions and 3 deletions
|
@ -268,6 +268,8 @@ namespace SourceGit.ViewModels
|
|||
public void Open()
|
||||
{
|
||||
var settingsFile = Path.Combine(_gitDir, "sourcegit.settings");
|
||||
if (File.Exists(settingsFile))
|
||||
{
|
||||
try
|
||||
{
|
||||
_settings = JsonSerializer.Deserialize(File.ReadAllText(settingsFile), JsonCodeGen.Default.RepositorySettings);
|
||||
|
@ -276,6 +278,11 @@ namespace SourceGit.ViewModels
|
|||
{
|
||||
_settings = new RepositorySettings();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
_settings = new RepositorySettings();
|
||||
}
|
||||
|
||||
_watcher = new Models.Watcher(this);
|
||||
_histories = new Histories(this);
|
||||
|
|
Loading…
Reference in a new issue