From 9da2c787dbf0dbac7cc26ce777672857d40e6066 Mon Sep 17 00:00:00 2001 From: leo Date: Fri, 21 Feb 2025 09:44:51 +0800 Subject: [PATCH] enhance: supports to configure `fetch.prune` for selected repository (#995) Signed-off-by: leo --- src/ViewModels/RepositoryConfigure.cs | 9 +++++++++ src/Views/RepositoryConfigure.axaml | 8 ++++++-- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/src/ViewModels/RepositoryConfigure.cs b/src/ViewModels/RepositoryConfigure.cs index a7c04937..cf23b6d8 100644 --- a/src/ViewModels/RepositoryConfigure.cs +++ b/src/ViewModels/RepositoryConfigure.cs @@ -60,6 +60,12 @@ namespace SourceGit.ViewModels set => SetProperty(ref _httpProxy, value); } + public bool EnablePruneOnFetch + { + get; + set; + } + public bool EnableAutoFetch { get => _repo.Settings.EnableAutoFetch; @@ -153,6 +159,8 @@ namespace SourceGit.ViewModels GPGUserSigningKey = signingKey; if (_cached.TryGetValue("http.proxy", out var proxy)) HttpProxy = proxy; + if (_cached.TryGetValue("fetch.prune", out var prune)) + EnablePruneOnFetch = (prune == "true"); } public void ClearHttpProxy() @@ -286,6 +294,7 @@ namespace SourceGit.ViewModels SetIfChanged("tag.gpgsign", GPGTagSigningEnabled ? "true" : "false", "false"); SetIfChanged("user.signingkey", GPGUserSigningKey, ""); SetIfChanged("http.proxy", HttpProxy, ""); + SetIfChanged("fetch.prune", EnablePruneOnFetch ? "true" : "false", "false"); } private void SetIfChanged(string key, string value, string defValue) diff --git a/src/Views/RepositoryConfigure.axaml b/src/Views/RepositoryConfigure.axaml index 61bc14e0..f6a02c49 100644 --- a/src/Views/RepositoryConfigure.axaml +++ b/src/Views/RepositoryConfigure.axaml @@ -44,7 +44,7 @@ - + - + + +