Skip to content

Commit 957fbbf

Browse files
committed
refactor: rewrite stash local changes
Signed-off-by: leo <[email protected]>
1 parent 1056902 commit 957fbbf

16 files changed

+92
-77
lines changed
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
using System.Collections.Generic;
2+
3+
namespace SourceGit.Models
4+
{
5+
public class DealWithChangesAfterStashing
6+
{
7+
public string Label { get; set; }
8+
public string Desc { get; set; }
9+
10+
public static readonly List<DealWithChangesAfterStashing> Supported = [
11+
new ("Discard", "All (or selected) changes will be discarded"),
12+
new ("Keep Index", "Staged changes are left intact"),
13+
new ("Keep All", "All (or selected) changes are left intact"),
14+
];
15+
16+
public DealWithChangesAfterStashing(string label, string desc)
17+
{
18+
Label = label;
19+
Desc = desc;
20+
}
21+
}
22+
}

src/Models/RepositorySettings.cs

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -176,17 +176,11 @@ public bool OnlyStagedWhenStash
176176
set;
177177
} = false;
178178

179-
public bool KeepIndexWhenStash
179+
public int ChangesAfterStashing
180180
{
181181
get;
182182
set;
183-
} = false;
184-
185-
public bool AutoRestoreAfterStash
186-
{
187-
get;
188-
set;
189-
} = false;
183+
} = 0;
190184

191185
public string PreferredOpenAIService
192186
{

src/Resources/Locales/de_DE.axaml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -669,10 +669,7 @@
669669
<x:String x:Key="Text.SSHKey.Placeholder" xml:space="preserve">Pfad zum privaten SSH Schlüssel</x:String>
670670
<x:String x:Key="Text.Start" xml:space="preserve">START</x:String>
671671
<x:String x:Key="Text.Stash" xml:space="preserve">Stash</x:String>
672-
<x:String x:Key="Text.Stash.AutoRestore" xml:space="preserve">Automatisch wiederherstellen nach dem Stashen</x:String>
673-
<x:String x:Key="Text.Stash.AutoRestore.Tip" xml:space="preserve">Die Arbeitsdateien bleiben unverändert, aber ein Stash wird gespeichert.</x:String>
674672
<x:String x:Key="Text.Stash.IncludeUntracked" xml:space="preserve">Inklusive nicht-verfolgter Dateien</x:String>
675-
<x:String x:Key="Text.Stash.KeepIndex" xml:space="preserve">Behalte gestagte Dateien</x:String>
676673
<x:String x:Key="Text.Stash.Message" xml:space="preserve">Name:</x:String>
677674
<x:String x:Key="Text.Stash.Message.Placeholder" xml:space="preserve">Optional. Name dieses Stashes</x:String>
678675
<x:String x:Key="Text.Stash.OnlyStagedChanges" xml:space="preserve">Nur gestagte Änderungen</x:String>

src/Resources/Locales/en_US.axaml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -689,10 +689,8 @@
689689
<x:String x:Key="Text.SSHKey.Placeholder" xml:space="preserve">Private SSH key store path</x:String>
690690
<x:String x:Key="Text.Start" xml:space="preserve">START</x:String>
691691
<x:String x:Key="Text.Stash" xml:space="preserve">Stash</x:String>
692-
<x:String x:Key="Text.Stash.AutoRestore" xml:space="preserve">Auto-restore after stashing</x:String>
693-
<x:String x:Key="Text.Stash.AutoRestore.Tip" xml:space="preserve">Your working files remain unchanged, but a stash is saved.</x:String>
692+
<x:String x:Key="Text.Stash.Changes" xml:space="preserve">Selected Changes:</x:String>
694693
<x:String x:Key="Text.Stash.IncludeUntracked" xml:space="preserve">Include untracked files</x:String>
695-
<x:String x:Key="Text.Stash.KeepIndex" xml:space="preserve">Keep staged files</x:String>
696694
<x:String x:Key="Text.Stash.Message" xml:space="preserve">Message:</x:String>
697695
<x:String x:Key="Text.Stash.Message.Placeholder" xml:space="preserve">Optional. Name of this stash</x:String>
698696
<x:String x:Key="Text.Stash.OnlyStagedChanges" xml:space="preserve">Only staged changes</x:String>

src/Resources/Locales/es_ES.axaml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -692,10 +692,7 @@
692692
<x:String x:Key="Text.SSHKey.Placeholder" xml:space="preserve">Ruta de almacenamiento de la clave privada SSH</x:String>
693693
<x:String x:Key="Text.Start" xml:space="preserve">INICIAR</x:String>
694694
<x:String x:Key="Text.Stash" xml:space="preserve">Stash</x:String>
695-
<x:String x:Key="Text.Stash.AutoRestore" xml:space="preserve">Restaurar automáticamente después del stashing</x:String>
696-
<x:String x:Key="Text.Stash.AutoRestore.Tip" xml:space="preserve">Tus archivos de trabajo permanecen sin cambios, pero se guarda un stash.</x:String>
697695
<x:String x:Key="Text.Stash.IncludeUntracked" xml:space="preserve">Incluir archivos no rastreados</x:String>
698-
<x:String x:Key="Text.Stash.KeepIndex" xml:space="preserve">Mantener archivos staged</x:String>
699696
<x:String x:Key="Text.Stash.Message" xml:space="preserve">Mensaje:</x:String>
700697
<x:String x:Key="Text.Stash.Message.Placeholder" xml:space="preserve">Opcional. Nombre de este stash</x:String>
701698
<x:String x:Key="Text.Stash.OnlyStagedChanges" xml:space="preserve">Solo cambios staged</x:String>

src/Resources/Locales/fr_FR.axaml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -645,10 +645,7 @@
645645
<x:String x:Key="Text.SSHKey.Placeholder" xml:space="preserve">Chemin du magasin de clés privées SSH</x:String>
646646
<x:String x:Key="Text.Start" xml:space="preserve">START</x:String>
647647
<x:String x:Key="Text.Stash" xml:space="preserve">Stash</x:String>
648-
<x:String x:Key="Text.Stash.AutoRestore" xml:space="preserve">Auto-restauration après le stash</x:String>
649-
<x:String x:Key="Text.Stash.AutoRestore.Tip" xml:space="preserve">Vos fichiers de travail restent inchangés, mais une sauvegarde est enregistrée.</x:String>
650648
<x:String x:Key="Text.Stash.IncludeUntracked" xml:space="preserve">Inclure les fichiers non-suivis</x:String>
651-
<x:String x:Key="Text.Stash.KeepIndex" xml:space="preserve">Garder les fichiers indexés</x:String>
652649
<x:String x:Key="Text.Stash.Message" xml:space="preserve">Message :</x:String>
653650
<x:String x:Key="Text.Stash.Message.Placeholder" xml:space="preserve">Optionnel. Nom de ce stash</x:String>
654651
<x:String x:Key="Text.Stash.OnlyStagedChanges" xml:space="preserve">Seulement les changements indexés</x:String>

src/Resources/Locales/it_IT.axaml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -673,10 +673,7 @@
673673
<x:String x:Key="Text.SSHKey.Placeholder" xml:space="preserve">Percorso per la chiave SSH privata</x:String>
674674
<x:String x:Key="Text.Start" xml:space="preserve">AVVIA</x:String>
675675
<x:String x:Key="Text.Stash" xml:space="preserve">Stasha</x:String>
676-
<x:String x:Key="Text.Stash.AutoRestore" xml:space="preserve">Auto-ripristino dopo lo stash</x:String>
677-
<x:String x:Key="Text.Stash.AutoRestore.Tip" xml:space="preserve">I tuoi file di lavoro rimangono inalterati, ma viene salvato uno stash.</x:String>
678676
<x:String x:Key="Text.Stash.IncludeUntracked" xml:space="preserve">Includi file non tracciati</x:String>
679-
<x:String x:Key="Text.Stash.KeepIndex" xml:space="preserve">Mantieni file in stage</x:String>
680677
<x:String x:Key="Text.Stash.Message" xml:space="preserve">Messaggio:</x:String>
681678
<x:String x:Key="Text.Stash.Message.Placeholder" xml:space="preserve">Opzionale. Nome di questo stash</x:String>
682679
<x:String x:Key="Text.Stash.OnlyStagedChanges" xml:space="preserve">Solo modifiche in stage</x:String>

src/Resources/Locales/ja_JP.axaml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -643,10 +643,7 @@
643643
<x:String x:Key="Text.SSHKey.Placeholder" xml:space="preserve">プライベートSSHキーストアのパス</x:String>
644644
<x:String x:Key="Text.Start" xml:space="preserve">スタート</x:String>
645645
<x:String x:Key="Text.Stash" xml:space="preserve">スタッシュ</x:String>
646-
<x:String x:Key="Text.Stash.AutoRestore" xml:space="preserve">スタッシュ後に自動で復元</x:String>
647-
<x:String x:Key="Text.Stash.AutoRestore.Tip" xml:space="preserve">作業ファイルは変更されず、スタッシュが保存されます。</x:String>
648646
<x:String x:Key="Text.Stash.IncludeUntracked" xml:space="preserve">追跡されていないファイルを含める</x:String>
649-
<x:String x:Key="Text.Stash.KeepIndex" xml:space="preserve">ステージされたファイルを保持</x:String>
650647
<x:String x:Key="Text.Stash.Message" xml:space="preserve">メッセージ:</x:String>
651648
<x:String x:Key="Text.Stash.Message.Placeholder" xml:space="preserve">オプション. このスタッシュの名前を入力</x:String>
652649
<x:String x:Key="Text.Stash.OnlyStagedChanges" xml:space="preserve">ステージされた変更のみ</x:String>

src/Resources/Locales/pt_BR.axaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -585,7 +585,6 @@
585585
<x:String x:Key="Text.Start" xml:space="preserve">INICIAR</x:String>
586586
<x:String x:Key="Text.Stash" xml:space="preserve">Stash</x:String>
587587
<x:String x:Key="Text.Stash.IncludeUntracked" xml:space="preserve">Incluir arquivos não rastreados</x:String>
588-
<x:String x:Key="Text.Stash.KeepIndex" xml:space="preserve">Manter arquivos em stage</x:String>
589588
<x:String x:Key="Text.Stash.Message" xml:space="preserve">Mensagem:</x:String>
590589
<x:String x:Key="Text.Stash.Message.Placeholder" xml:space="preserve">Opcional. Nome deste stash</x:String>
591590
<x:String x:Key="Text.Stash.OnlyStagedChanges" xml:space="preserve">Apenas mudanças em stage</x:String>

src/Resources/Locales/ru_RU.axaml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -690,10 +690,7 @@
690690
<x:String x:Key="Text.SSHKey.Placeholder" xml:space="preserve">Путь хранения приватного ключа SSH</x:String>
691691
<x:String x:Key="Text.Start" xml:space="preserve">ЗАПУСК</x:String>
692692
<x:String x:Key="Text.Stash" xml:space="preserve">Отложить</x:String>
693-
<x:String x:Key="Text.Stash.AutoRestore" xml:space="preserve">Автоматически восстанавливать после откладывания</x:String>
694-
<x:String x:Key="Text.Stash.AutoRestore.Tip" xml:space="preserve">Ваши рабочие файлы остаются неизменными, но отложенные сохранятся.</x:String>
695693
<x:String x:Key="Text.Stash.IncludeUntracked" xml:space="preserve">Включить неотслеживаемые файлы</x:String>
696-
<x:String x:Key="Text.Stash.KeepIndex" xml:space="preserve">Хранить отложенные файлы</x:String>
697694
<x:String x:Key="Text.Stash.Message" xml:space="preserve">Сообщение:</x:String>
698695
<x:String x:Key="Text.Stash.Message.Placeholder" xml:space="preserve">Имя тайника (необязательно)</x:String>
699696
<x:String x:Key="Text.Stash.OnlyStagedChanges" xml:space="preserve">Только сформированные изменения</x:String>

0 commit comments

Comments
 (0)