mirror of
https://github.com/sourcegit-scm/sourcegit.git
synced 2025-01-11 23:57:21 -08:00
enhance: remember last selection of some options while stashing changes (#610)
Signed-off-by: leo <longshuang@msn.cn>
This commit is contained in:
parent
1418591b0b
commit
6cc0c54ac1
2 changed files with 24 additions and 10 deletions
|
@ -112,6 +112,24 @@ namespace SourceGit.Models
|
||||||
set;
|
set;
|
||||||
} = false;
|
} = false;
|
||||||
|
|
||||||
|
public bool IncludeUntrackedWhenStash
|
||||||
|
{
|
||||||
|
get;
|
||||||
|
set;
|
||||||
|
} = true;
|
||||||
|
|
||||||
|
public bool OnlyStagedWhenStash
|
||||||
|
{
|
||||||
|
get;
|
||||||
|
set;
|
||||||
|
} = false;
|
||||||
|
|
||||||
|
public bool KeepIndexWhenStash
|
||||||
|
{
|
||||||
|
get;
|
||||||
|
set;
|
||||||
|
} = false;
|
||||||
|
|
||||||
public void PushCommitMessage(string message)
|
public void PushCommitMessage(string message)
|
||||||
{
|
{
|
||||||
var existIdx = CommitMessages.IndexOf(message);
|
var existIdx = CommitMessages.IndexOf(message);
|
||||||
|
|
|
@ -18,31 +18,27 @@ namespace SourceGit.ViewModels
|
||||||
|
|
||||||
public bool IncludeUntracked
|
public bool IncludeUntracked
|
||||||
{
|
{
|
||||||
get;
|
get => _repo.Settings.IncludeUntrackedWhenStash;
|
||||||
set;
|
set => _repo.Settings.IncludeUntrackedWhenStash = value;
|
||||||
}
|
}
|
||||||
|
|
||||||
public bool OnlyStaged
|
public bool OnlyStaged
|
||||||
{
|
{
|
||||||
get;
|
get => _repo.Settings.OnlyStagedWhenStash;
|
||||||
set;
|
set => _repo.Settings.OnlyStagedWhenStash = value;
|
||||||
}
|
}
|
||||||
|
|
||||||
public bool KeepIndex
|
public bool KeepIndex
|
||||||
{
|
{
|
||||||
get;
|
get => _repo.Settings.KeepIndexWhenStash;
|
||||||
set;
|
set => _repo.Settings.KeepIndexWhenStash = value;
|
||||||
}
|
}
|
||||||
|
|
||||||
public StashChanges(Repository repo, List<Models.Change> changes, bool hasSelectedFiles)
|
public StashChanges(Repository repo, List<Models.Change> changes, bool hasSelectedFiles)
|
||||||
{
|
{
|
||||||
_repo = repo;
|
_repo = repo;
|
||||||
_changes = changes;
|
_changes = changes;
|
||||||
|
|
||||||
HasSelectedFiles = hasSelectedFiles;
|
HasSelectedFiles = hasSelectedFiles;
|
||||||
IncludeUntracked = true;
|
|
||||||
OnlyStaged = false;
|
|
||||||
KeepIndex = false;
|
|
||||||
|
|
||||||
View = new Views.StashChanges() { DataContext = this };
|
View = new Views.StashChanges() { DataContext = this };
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue