feature: add option to enable --keep-index option of git stash push command (#610)

Signed-off-by: leo <longshuang@msn.cn>
This commit is contained in:
leo 2024-10-28 16:51:42 +08:00
parent 3e6e0befaa
commit 566d36ca59
No known key found for this signature in database
6 changed files with 22 additions and 5 deletions

View file

@ -28,6 +28,12 @@ namespace SourceGit.ViewModels
set;
}
public bool KeepIndex
{
get;
set;
}
public StashChanges(Repository repo, List<Models.Change> changes, bool hasSelectedFiles)
{
_repo = repo;
@ -36,6 +42,7 @@ namespace SourceGit.ViewModels
HasSelectedFiles = hasSelectedFiles;
IncludeUntracked = true;
OnlyStaged = false;
KeepIndex = false;
View = new Views.StashChanges() { DataContext = this };
}
@ -63,7 +70,7 @@ namespace SourceGit.ViewModels
return Task.Run(() =>
{
var succ = new Commands.Stash(_repo.FullPath).Push(jobs, Message, !HasSelectedFiles && OnlyStaged);
var succ = new Commands.Stash(_repo.FullPath).Push(jobs, Message, !HasSelectedFiles && OnlyStaged, KeepIndex);
CallUIThread(() =>
{
_repo.MarkWorkingCopyDirtyManually();