mirror of
https://github.com/sourcegit-scm/sourcegit
synced 2025-05-21 04:04:59 +00:00
enhance: remember last selected on common actions (#231)
* the way to deal with local changes on checkout branch page * the way to deal with local changes and should checkout after created on new branch page * should fetch without tags on fetch page * the way to deal with local changes and should fetch without tags on pull page * should push all tags on push
This commit is contained in:
parent
7e16058148
commit
f4f4a26a64
6 changed files with 68 additions and 27 deletions
|
@ -12,8 +12,8 @@ namespace SourceGit.ViewModels
|
|||
|
||||
public Models.DealWithLocalChanges PreAction
|
||||
{
|
||||
get => _preAction;
|
||||
set => SetProperty(ref _preAction, value);
|
||||
get => _repo.Settings.DealWithLocalChangesOnCheckoutBranch;
|
||||
set => _repo.Settings.DealWithLocalChangesOnCheckoutBranch = value;
|
||||
}
|
||||
|
||||
public Checkout(Repository repo, string branch)
|
||||
|
@ -34,7 +34,7 @@ namespace SourceGit.ViewModels
|
|||
var needPopStash = false;
|
||||
if (hasLocalChanges)
|
||||
{
|
||||
if (_preAction == Models.DealWithLocalChanges.StashAndReaply)
|
||||
if (PreAction == Models.DealWithLocalChanges.StashAndReaply)
|
||||
{
|
||||
SetProgressDescription("Adding untracked changes ...");
|
||||
var succ = new Commands.Add(_repo.FullPath).Exec();
|
||||
|
@ -52,7 +52,7 @@ namespace SourceGit.ViewModels
|
|||
|
||||
needPopStash = true;
|
||||
}
|
||||
else if (_preAction == Models.DealWithLocalChanges.Discard)
|
||||
else if (PreAction == Models.DealWithLocalChanges.Discard)
|
||||
{
|
||||
SetProgressDescription("Discard local changes ...");
|
||||
Commands.Discard.All(_repo.FullPath);
|
||||
|
@ -78,6 +78,5 @@ namespace SourceGit.ViewModels
|
|||
}
|
||||
|
||||
private readonly Repository _repo = null;
|
||||
private Models.DealWithLocalChanges _preAction = Models.DealWithLocalChanges.DoNothing;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue