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,11 +268,18 @@ namespace SourceGit.ViewModels
|
||||||
public void Open()
|
public void Open()
|
||||||
{
|
{
|
||||||
var settingsFile = Path.Combine(_gitDir, "sourcegit.settings");
|
var settingsFile = Path.Combine(_gitDir, "sourcegit.settings");
|
||||||
try
|
if (File.Exists(settingsFile))
|
||||||
{
|
{
|
||||||
_settings = JsonSerializer.Deserialize(File.ReadAllText(settingsFile), JsonCodeGen.Default.RepositorySettings);
|
try
|
||||||
|
{
|
||||||
|
_settings = JsonSerializer.Deserialize(File.ReadAllText(settingsFile), JsonCodeGen.Default.RepositorySettings);
|
||||||
|
}
|
||||||
|
catch
|
||||||
|
{
|
||||||
|
_settings = new RepositorySettings();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
catch
|
else
|
||||||
{
|
{
|
||||||
_settings = new RepositorySettings();
|
_settings = new RepositorySettings();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue