mirror of
https://github.com/sourcegit-scm/sourcegit.git
synced 2024-12-24 20:57:19 -08:00
enhance: do NOT modify repository's local configuration if it is equals to default value
This commit is contained in:
parent
886b242b66
commit
cc6e486663
1 changed files with 8 additions and 8 deletions
|
@ -138,22 +138,22 @@ namespace SourceGit.ViewModels
|
|||
|
||||
public void Save()
|
||||
{
|
||||
SetIfChanged("user.name", UserName);
|
||||
SetIfChanged("user.email", UserEmail);
|
||||
SetIfChanged("commit.gpgsign", GPGCommitSigningEnabled ? "true" : "false");
|
||||
SetIfChanged("tag.gpgsign", GPGTagSigningEnabled ? "true" : "false");
|
||||
SetIfChanged("user.signingkey", GPGUserSigningKey);
|
||||
SetIfChanged("http.proxy", HttpProxy);
|
||||
SetIfChanged("user.name", UserName, "");
|
||||
SetIfChanged("user.email", UserEmail, "");
|
||||
SetIfChanged("commit.gpgsign", GPGCommitSigningEnabled ? "true" : "false", "false");
|
||||
SetIfChanged("tag.gpgsign", GPGTagSigningEnabled ? "true" : "false", "false");
|
||||
SetIfChanged("user.signingkey", GPGUserSigningKey, "");
|
||||
SetIfChanged("http.proxy", HttpProxy, "");
|
||||
}
|
||||
|
||||
private void SetIfChanged(string key, string value)
|
||||
private void SetIfChanged(string key, string value, string defValue)
|
||||
{
|
||||
bool changed = false;
|
||||
if (_cached.TryGetValue(key, out var old))
|
||||
{
|
||||
changed = old != value;
|
||||
}
|
||||
else if (!string.IsNullOrEmpty(value))
|
||||
else if (!string.IsNullOrEmpty(value) && value != defValue)
|
||||
{
|
||||
changed = true;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue