From 6dac26d52555597b854bb53529b4296ff9e12c96 Mon Sep 17 00:00:00 2001 From: leo Date: Tue, 22 Oct 2024 09:29:49 +0800 Subject: [PATCH] refactor: since there is a hotkey to stage and commit, remove the unsafe auto-stage configure --- src/Models/RepositorySettings.cs | 6 ------ src/Resources/Locales/de_DE.axaml | 1 - src/Resources/Locales/en_US.axaml | 1 - src/Resources/Locales/fr_FR.axaml | 1 - src/Resources/Locales/pt_BR.axaml | 1 - src/Resources/Locales/ru_RU.axaml | 1 - src/Resources/Locales/zh_CN.axaml | 1 - src/Resources/Locales/zh_TW.axaml | 1 - src/ViewModels/WorkingCopy.cs | 10 ++-------- src/Views/WorkingCopy.axaml | 17 +++++------------ 10 files changed, 7 insertions(+), 33 deletions(-) diff --git a/src/Models/RepositorySettings.cs b/src/Models/RepositorySettings.cs index f2fd1bc6..c48e3c0c 100644 --- a/src/Models/RepositorySettings.cs +++ b/src/Models/RepositorySettings.cs @@ -70,12 +70,6 @@ namespace SourceGit.Models set; } = true; - public bool AutoStageBeforeCommit - { - get; - set; - } = false; - public AvaloniaList Filters { get; diff --git a/src/Resources/Locales/de_DE.axaml b/src/Resources/Locales/de_DE.axaml index 7cc9fd63..f5a6c91c 100644 --- a/src/Resources/Locales/de_DE.axaml +++ b/src/Resources/Locales/de_DE.axaml @@ -622,7 +622,6 @@ Ignoriere Dateien im selben Ordner Ignoriere nur diese Datei Amend - Auto-Stage Du kannst diese Datei jetzt stagen. COMMIT COMMIT & PUSH diff --git a/src/Resources/Locales/en_US.axaml b/src/Resources/Locales/en_US.axaml index bfb0ace4..2a475acd 100644 --- a/src/Resources/Locales/en_US.axaml +++ b/src/Resources/Locales/en_US.axaml @@ -631,7 +631,6 @@ Ignore files in the same folder Ignore this file only Amend - Auto-Stage You can stage this file now. COMMIT COMMIT & PUSH diff --git a/src/Resources/Locales/fr_FR.axaml b/src/Resources/Locales/fr_FR.axaml index 8e56248d..631750dd 100644 --- a/src/Resources/Locales/fr_FR.axaml +++ b/src/Resources/Locales/fr_FR.axaml @@ -582,7 +582,6 @@ Ignorer les fichiers dans le même dossier N'ignorer que ce fichier Amender - Auto-Index Vous pouvez indexer ce fichier. COMMIT COMMIT & PUSH diff --git a/src/Resources/Locales/pt_BR.axaml b/src/Resources/Locales/pt_BR.axaml index 8a970730..362e81f1 100644 --- a/src/Resources/Locales/pt_BR.axaml +++ b/src/Resources/Locales/pt_BR.axaml @@ -575,7 +575,6 @@ Ignorar arquivos na mesma pasta Ignorar apenas este arquivo Corrigir - Auto-Stage Você pode stagear este arquivo agora. COMMIT COMMIT & PUSH diff --git a/src/Resources/Locales/ru_RU.axaml b/src/Resources/Locales/ru_RU.axaml index 23ec125f..e331ac31 100644 --- a/src/Resources/Locales/ru_RU.axaml +++ b/src/Resources/Locales/ru_RU.axaml @@ -634,7 +634,6 @@ Игнорировать файлы в том же каталоге Игнорировать только эти файлы Изменить - Автоподготовка Теперь вы можете подготовитть этот файл. ЗАФИКСИРОВАТЬ ЗАФИКСИРОВАТЬ и ОТПРАВИТЬ diff --git a/src/Resources/Locales/zh_CN.axaml b/src/Resources/Locales/zh_CN.axaml index 919e4093..e8346fa3 100644 --- a/src/Resources/Locales/zh_CN.axaml +++ b/src/Resources/Locales/zh_CN.axaml @@ -629,7 +629,6 @@ 忽略同目录下所有文件 忽略本文件 修补(--amend) - 自动暂存 现在您已可将其加入暂存区中 提交 提交并推送 diff --git a/src/Resources/Locales/zh_TW.axaml b/src/Resources/Locales/zh_TW.axaml index bccf4aab..fb6489cf 100644 --- a/src/Resources/Locales/zh_TW.axaml +++ b/src/Resources/Locales/zh_TW.axaml @@ -634,7 +634,6 @@ 忽略同路徑下所有檔案 忽略本檔案 修補 (--amend) - 自動暫存 現在您已可將其加入暫存區中 提 交 提交並推送 diff --git a/src/ViewModels/WorkingCopy.cs b/src/ViewModels/WorkingCopy.cs index 70b4f11f..209da812 100644 --- a/src/ViewModels/WorkingCopy.cs +++ b/src/ViewModels/WorkingCopy.cs @@ -79,12 +79,6 @@ namespace SourceGit.ViewModels private set => SetProperty(ref _isCommitting, value); } - public bool AutoStageBeforeCommit - { - get => _repo.Settings.AutoStageBeforeCommit; - set => _repo.Settings.AutoStageBeforeCommit = value; - } - public bool UseAmend { get => _useAmend; @@ -416,7 +410,7 @@ namespace SourceGit.ViewModels public void Commit() { - DoCommit(AutoStageBeforeCommit, false); + DoCommit(false, false); } public void CommitWithAutoStage() @@ -426,7 +420,7 @@ namespace SourceGit.ViewModels public void CommitWithPush() { - DoCommit(AutoStageBeforeCommit, true); + DoCommit(false, true); } public ContextMenu CreateContextMenuForUnstagedChanges() diff --git a/src/Views/WorkingCopy.axaml b/src/Views/WorkingCopy.axaml index 1b289e9e..3333cda1 100644 --- a/src/Views/WorkingCopy.axaml +++ b/src/Views/WorkingCopy.axaml @@ -185,7 +185,7 @@ - +