diff --git a/src/Commands/Fetch.cs b/src/Commands/Fetch.cs index 1c3e78cb..06ae8cb6 100644 --- a/src/Commands/Fetch.cs +++ b/src/Commands/Fetch.cs @@ -4,7 +4,7 @@ namespace SourceGit.Commands { public class Fetch : Command { - public Fetch(string repo, string remote, bool noTags, bool prune, bool force, Action outputHandler) + public Fetch(string repo, string remote, bool noTags, bool force, Action outputHandler) { _outputHandler = outputHandler; WorkingDirectory = repo; @@ -21,9 +21,6 @@ namespace SourceGit.Commands if (force) Args += "--force "; - if (prune) - Args += "--prune "; - Args += remote; } diff --git a/src/Commands/Pull.cs b/src/Commands/Pull.cs index 732530f5..a4efa4b6 100644 --- a/src/Commands/Pull.cs +++ b/src/Commands/Pull.cs @@ -4,7 +4,7 @@ namespace SourceGit.Commands { public class Pull : Command { - public Pull(string repo, string remote, string branch, bool useRebase, bool noTags, bool prune, Action outputHandler) + public Pull(string repo, string remote, string branch, bool useRebase, bool noTags, Action outputHandler) { _outputHandler = outputHandler; WorkingDirectory = repo; @@ -17,8 +17,6 @@ namespace SourceGit.Commands Args += "--rebase "; if (noTags) Args += "--no-tags "; - if (prune) - Args += "--prune "; Args += $"{remote} {branch}"; } diff --git a/src/Models/RepositorySettings.cs b/src/Models/RepositorySettings.cs index 1d0b3c10..d2d0c2f3 100644 --- a/src/Models/RepositorySettings.cs +++ b/src/Models/RepositorySettings.cs @@ -56,12 +56,6 @@ namespace SourceGit.Models set; } = DealWithLocalChanges.DoNothing; - public bool EnablePruneOnFetch - { - get; - set; - } = false; - public bool EnableForceOnFetch { get; diff --git a/src/Resources/Locales/de_DE.axaml b/src/Resources/Locales/de_DE.axaml index 77799713..8d92c6cc 100644 --- a/src/Resources/Locales/de_DE.axaml +++ b/src/Resources/Locales/de_DE.axaml @@ -160,7 +160,6 @@ Remotes automatisch fetchen Minute(n) Standard Remote - Aktivere --prune beim fetchen TICKETSYSTEM Beispiel für Gitee Issue Regel einfügen Beispiel für Gitee Pull Request Regel einfügen @@ -477,6 +476,7 @@ Klon Standardordner Benutzer Email Globale Git Benutzer Email + Aktivere --prune beim fetchen Installationspfad Aktiviere HTTP SSL Verifizierung Benutzername diff --git a/src/Resources/Locales/en_US.axaml b/src/Resources/Locales/en_US.axaml index 64b5e5a2..28951aa9 100644 --- a/src/Resources/Locales/en_US.axaml +++ b/src/Resources/Locales/en_US.axaml @@ -157,7 +157,6 @@ Fetch remotes automatically Minute(s) Default Remote - Enable --prune on fetch ISSUE TRACKER Add Sample Gitee Issue Rule Add Sample Gitee Pull Request Rule @@ -475,6 +474,7 @@ Default Clone Dir User Email Global git user email + Enable --prune on fetch Install Path Enable HTTP SSL Verify User Name diff --git a/src/Resources/Locales/es_ES.axaml b/src/Resources/Locales/es_ES.axaml index 31e2c5e5..a760a470 100644 --- a/src/Resources/Locales/es_ES.axaml +++ b/src/Resources/Locales/es_ES.axaml @@ -160,7 +160,6 @@ Fetch remotos automáticamente Minuto(s) Remoto por Defecto - Habilitar --prune para fetch SEGUIMIENTO DE INCIDENCIAS Añadir Regla de Ejemplo para Incidencias de Gitee Añadir Regla de Ejemplo para Pull Requests de Gitee @@ -478,6 +477,7 @@ Directorio de clonado por defecto Email de usuario Email global del usuario git + Habilitar --prune para fetch Ruta de instalación Habilitar verificación HTTP SSL Nombre de usuario diff --git a/src/Resources/Locales/fr_FR.axaml b/src/Resources/Locales/fr_FR.axaml index 4eef3815..da20a5ee 100644 --- a/src/Resources/Locales/fr_FR.axaml +++ b/src/Resources/Locales/fr_FR.axaml @@ -161,7 +161,6 @@ Fetch les dépôts distants automatiquement minute(s) Dépôt par défaut - Activer --prune pour fetch SUIVI DES PROBLÈMES Ajouter une règle d'exemple Gitee Ajouter une règle d'exemple pour Pull Request Gitee @@ -466,6 +465,7 @@ Répertoire de clônage par défaut E-mail utilsateur E-mail utilsateur global + Activer --prune pour fetch Chemin d'installation Nom d'utilisateur Nom d'utilisateur global diff --git a/src/Resources/Locales/it_IT.axaml b/src/Resources/Locales/it_IT.axaml index e63ed323..5a23ad82 100644 --- a/src/Resources/Locales/it_IT.axaml +++ b/src/Resources/Locales/it_IT.axaml @@ -155,7 +155,6 @@ Recupera automaticamente i remoti Minuto/i Remoto Predefinito - Abilita --prune durante il fetch TRACCIAMENTO ISSUE Aggiungi Regola Esempio per GitHub Aggiungi Regola Esempio per Jira @@ -457,6 +456,7 @@ Cartella predefinita per cloni Email Utente Email globale utente Git + Abilita --prune durante il fetch Percorso Installazione Nome Utente Nome globale utente Git diff --git a/src/Resources/Locales/pt_BR.axaml b/src/Resources/Locales/pt_BR.axaml index 7979d1b2..d29ace6b 100644 --- a/src/Resources/Locales/pt_BR.axaml +++ b/src/Resources/Locales/pt_BR.axaml @@ -180,7 +180,6 @@ Buscar remotos automaticamente Minuto(s) Remoto padrão - Habilita --prune ao buscar RASTREADOR DE PROBLEMAS Adicionar Regra de Exemplo do Github Adicionar Regra de Exemplo do Jira @@ -480,6 +479,7 @@ Diretório de Clone Padrão Email do Usuário Email global do usuário git + Habilita --prune ao buscar Caminho de Instalação Nome do Usuário Nome global do usuário git diff --git a/src/Resources/Locales/ru_RU.axaml b/src/Resources/Locales/ru_RU.axaml index 1d6e9215..53a97549 100644 --- a/src/Resources/Locales/ru_RU.axaml +++ b/src/Resources/Locales/ru_RU.axaml @@ -160,7 +160,6 @@ Автоматическое скачивание изменений Минут(а/ы) Внешний репозиторий по умолчанию - Разрешить '--prune' при скачивании ОТСЛЕЖИВАНИЕ ПРОБЛЕМ Добавить пример правила для тем в Gitee Добавить пример правила запроса скачивания из Gitee @@ -478,6 +477,7 @@ Каталог клонирования по умолчанию Электроная почта пользователя Общая электроная почта пользователя git + Разрешить '--prune' при скачивании Путь установки Разрешить верификацию HTTP SSL Имя пользователя diff --git a/src/Resources/Locales/zh_CN.axaml b/src/Resources/Locales/zh_CN.axaml index 7a798a0a..ea181b50 100644 --- a/src/Resources/Locales/zh_CN.axaml +++ b/src/Resources/Locales/zh_CN.axaml @@ -160,7 +160,6 @@ 启用定时自动拉取远程更新 分钟 默认远程 - 拉取更新时启用修剪(--prune) ISSUE追踪 新增匹配Gitee议题规则 新增匹配Gitee合并请求规则 @@ -479,6 +478,7 @@ 默认克隆路径 邮箱 默认GIT用户邮箱 + 拉取更新时启用修剪(--prune) 安装路径 启用HTTP SSL验证 用户名 diff --git a/src/Resources/Locales/zh_TW.axaml b/src/Resources/Locales/zh_TW.axaml index 7e3bb2d5..077a8b0b 100644 --- a/src/Resources/Locales/zh_TW.axaml +++ b/src/Resources/Locales/zh_TW.axaml @@ -160,7 +160,6 @@ 啟用定時自動提取 (fetch) 遠端更新 分鐘 預設遠端存放庫 - 拉取變更時進行清理 (--prune) Issue 追蹤 新增符合 Gitee 議題規則 新增符合 Gitee 合併請求規則 @@ -478,6 +477,7 @@ 預設複製 (clone) 路徑 電子郵件 預設 Git 使用者電子郵件 + 拉取變更時進行清理 (--prune) 安裝路徑 啟用 HTTP SSL 驗證 使用者名稱 diff --git a/src/ViewModels/AddRemote.cs b/src/ViewModels/AddRemote.cs index 2ca7449f..d6424572 100644 --- a/src/ViewModels/AddRemote.cs +++ b/src/ViewModels/AddRemote.cs @@ -100,7 +100,7 @@ namespace SourceGit.ViewModels { SetProgressDescription("Fetching from added remote ..."); new Commands.Config(_repo.FullPath).Set($"remote.{_name}.sshkey", _useSSH ? SSHKey : null); - new Commands.Fetch(_repo.FullPath, _name, false, false, false, SetProgressDescription).Exec(); + new Commands.Fetch(_repo.FullPath, _name, false, false, SetProgressDescription).Exec(); } CallUIThread(() => { diff --git a/src/ViewModels/Fetch.cs b/src/ViewModels/Fetch.cs index 2d907edd..d816d0b8 100644 --- a/src/ViewModels/Fetch.cs +++ b/src/ViewModels/Fetch.cs @@ -47,7 +47,6 @@ namespace SourceGit.ViewModels _repo.SetWatcherEnabled(false); var notags = _repo.Settings.FetchWithoutTags; - var prune = _repo.Settings.EnablePruneOnFetch; var force = _repo.Settings.EnableForceOnFetch; return Task.Run(() => { @@ -56,13 +55,13 @@ namespace SourceGit.ViewModels foreach (var remote in _repo.Remotes) { SetProgressDescription($"Fetching remote: {remote.Name}"); - new Commands.Fetch(_repo.FullPath, remote.Name, notags, prune, force, SetProgressDescription).Exec(); + new Commands.Fetch(_repo.FullPath, remote.Name, notags, force, SetProgressDescription).Exec(); } } else { SetProgressDescription($"Fetching remote: {SelectedRemote.Name}"); - new Commands.Fetch(_repo.FullPath, SelectedRemote.Name, notags, prune, force, SetProgressDescription).Exec(); + new Commands.Fetch(_repo.FullPath, SelectedRemote.Name, notags, force, SetProgressDescription).Exec(); } CallUIThread(() => diff --git a/src/ViewModels/Pull.cs b/src/ViewModels/Pull.cs index e7c62980..52f98d87 100644 --- a/src/ViewModels/Pull.cs +++ b/src/ViewModels/Pull.cs @@ -151,7 +151,6 @@ namespace SourceGit.ViewModels _repo.FullPath, _selectedRemote.Name, NoTags, - _repo.Settings.EnablePruneOnFetch, false, SetProgressDescription).Exec(); @@ -184,7 +183,6 @@ namespace SourceGit.ViewModels _selectedBranch.Name, UseRebase, NoTags, - _repo.Settings.EnablePruneOnFetch, SetProgressDescription).Exec(); } diff --git a/src/ViewModels/Repository.cs b/src/ViewModels/Repository.cs index 4a606c9e..926fd6b6 100644 --- a/src/ViewModels/Repository.cs +++ b/src/ViewModels/Repository.cs @@ -2361,7 +2361,7 @@ namespace SourceGit.ViewModels Dispatcher.UIThread.Invoke(() => IsAutoFetching = true); foreach (var remote in remotes) - new Commands.Fetch(_fullpath, remote, false, _settings.EnablePruneOnFetch, false, null) { RaiseError = false }.Exec(); + new Commands.Fetch(_fullpath, remote, false, false, null) { RaiseError = false }.Exec(); _lastFetchTime = DateTime.Now; Dispatcher.UIThread.Invoke(() => IsAutoFetching = false); } diff --git a/src/ViewModels/RepositoryConfigure.cs b/src/ViewModels/RepositoryConfigure.cs index 9cafde0a..a7c04937 100644 --- a/src/ViewModels/RepositoryConfigure.cs +++ b/src/ViewModels/RepositoryConfigure.cs @@ -60,12 +60,6 @@ namespace SourceGit.ViewModels set => SetProperty(ref _httpProxy, value); } - public bool EnablePruneOnFetch - { - get => _repo.Settings.EnablePruneOnFetch; - set => _repo.Settings.EnablePruneOnFetch = value; - } - public bool EnableAutoFetch { get => _repo.Settings.EnableAutoFetch; diff --git a/src/Views/Preferences.axaml b/src/Views/Preferences.axaml index 7f3633ad..1d282ad9 100644 --- a/src/Views/Preferences.axaml +++ b/src/Views/Preferences.axaml @@ -255,7 +255,7 @@ - + + + diff --git a/src/Views/Preferences.axaml.cs b/src/Views/Preferences.axaml.cs index 2bc5c571..4696b4a7 100644 --- a/src/Views/Preferences.axaml.cs +++ b/src/Views/Preferences.axaml.cs @@ -28,6 +28,12 @@ namespace SourceGit.Views set; } = null; + public bool EnablePruneOnFetch + { + get; + set; + } + public static readonly StyledProperty GitVersionProperty = AvaloniaProperty.Register(nameof(GitVersion)); @@ -114,6 +120,8 @@ namespace SourceGit.Views GPGUserKey = signingKey; if (config.TryGetValue("core.autocrlf", out var crlf)) CRLFMode = Models.CRLFMode.Supported.Find(x => x.Value == crlf); + if (config.TryGetValue("fetch.prune", out var pruneOnFetch)) + EnablePruneOnFetch = (pruneOnFetch == "true"); if (config.TryGetValue("commit.gpgsign", out var gpgCommitSign)) EnableGPGCommitSigning = (gpgCommitSign == "true"); if (config.TryGetValue("tag.gpgsign", out var gpgTagSign)) @@ -157,6 +165,7 @@ namespace SourceGit.Views SetIfChanged(config, "user.email", DefaultEmail, ""); SetIfChanged(config, "user.signingkey", GPGUserKey, ""); SetIfChanged(config, "core.autocrlf", CRLFMode != null ? CRLFMode.Value : null, null); + SetIfChanged(config, "fetch.prune", EnablePruneOnFetch ? "true" : "false", "false"); SetIfChanged(config, "commit.gpgsign", EnableGPGCommitSigning ? "true" : "false", "false"); SetIfChanged(config, "tag.gpgsign", EnableGPGTagSigning ? "true" : "false", "false"); SetIfChanged(config, "http.sslverify", EnableHTTPSSLVerify ? "" : "false", ""); diff --git a/src/Views/RepositoryConfigure.axaml b/src/Views/RepositoryConfigure.axaml index 8ba242d5..5e9374f9 100644 --- a/src/Views/RepositoryConfigure.axaml +++ b/src/Views/RepositoryConfigure.axaml @@ -45,7 +45,7 @@ - + - - - +