mirror of
https://github.com/sourcegit-scm/sourcegit.git
synced 2024-12-24 20:57:19 -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()
|
public void Open()
|
||||||
{
|
{
|
||||||
var settingsFile = Path.Combine(_gitDir, "sourcegit.settings");
|
var settingsFile = Path.Combine(_gitDir, "sourcegit.settings");
|
||||||
|
if (File.Exists(settingsFile))
|
||||||
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
_settings = JsonSerializer.Deserialize(File.ReadAllText(settingsFile), JsonCodeGen.Default.RepositorySettings);
|
_settings = JsonSerializer.Deserialize(File.ReadAllText(settingsFile), JsonCodeGen.Default.RepositorySettings);
|
||||||
|
@ -276,6 +278,11 @@ namespace SourceGit.ViewModels
|
||||||
{
|
{
|
||||||
_settings = new RepositorySettings();
|
_settings = new RepositorySettings();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
_settings = new RepositorySettings();
|
||||||
|
}
|
||||||
|
|
||||||
_watcher = new Models.Watcher(this);
|
_watcher = new Models.Watcher(this);
|
||||||
_histories = new Histories(this);
|
_histories = new Histories(this);
|
||||||
|
|
Loading…
Reference in a new issue