mirror of
https://github.com/sourcegit-scm/sourcegit
synced 2025-05-21 20:24:59 +00:00
enhance: do not call git add
before git stash push
when enable auto stash in checkout/create branch/pull (#316)
This commit is contained in:
parent
6c5175704e
commit
71c2ad989b
4 changed files with 8 additions and 32 deletions
|
@ -35,15 +35,9 @@ namespace SourceGit.ViewModels
|
||||||
if (hasLocalChanges)
|
if (hasLocalChanges)
|
||||||
{
|
{
|
||||||
if (PreAction == Models.DealWithLocalChanges.StashAndReaply)
|
if (PreAction == Models.DealWithLocalChanges.StashAndReaply)
|
||||||
{
|
|
||||||
SetProgressDescription("Adding untracked changes ...");
|
|
||||||
var succ = new Commands.Add(_repo.FullPath).Exec();
|
|
||||||
if (succ)
|
|
||||||
{
|
{
|
||||||
SetProgressDescription("Stash local changes ...");
|
SetProgressDescription("Stash local changes ...");
|
||||||
succ = new Commands.Stash(_repo.FullPath).Push("CHECKOUT_AUTO_STASH");
|
var succ = new Commands.Stash(_repo.FullPath).Push("CHECKOUT_AUTO_STASH");
|
||||||
}
|
|
||||||
|
|
||||||
if (!succ)
|
if (!succ)
|
||||||
{
|
{
|
||||||
CallUIThread(() => _repo.SetWatcherEnabled(true));
|
CallUIThread(() => _repo.SetWatcherEnabled(true));
|
||||||
|
|
|
@ -39,15 +39,9 @@ namespace SourceGit.ViewModels
|
||||||
if (HasLocalChanges)
|
if (HasLocalChanges)
|
||||||
{
|
{
|
||||||
if (AutoStash)
|
if (AutoStash)
|
||||||
{
|
|
||||||
SetProgressDescription("Adding untracked changes ...");
|
|
||||||
var succ = new Commands.Add(_repo.FullPath).Exec();
|
|
||||||
if (succ)
|
|
||||||
{
|
{
|
||||||
SetProgressDescription("Stash local changes ...");
|
SetProgressDescription("Stash local changes ...");
|
||||||
succ = new Commands.Stash(_repo.FullPath).Push("CHECKOUT_AUTO_STASH");
|
var succ = new Commands.Stash(_repo.FullPath).Push("CHECKOUT_AUTO_STASH");
|
||||||
}
|
|
||||||
|
|
||||||
if (!succ)
|
if (!succ)
|
||||||
{
|
{
|
||||||
CallUIThread(() => _repo.SetWatcherEnabled(true));
|
CallUIThread(() => _repo.SetWatcherEnabled(true));
|
||||||
|
|
|
@ -90,15 +90,9 @@ namespace SourceGit.ViewModels
|
||||||
if (_repo.WorkingCopyChangesCount > 0)
|
if (_repo.WorkingCopyChangesCount > 0)
|
||||||
{
|
{
|
||||||
if (PreAction == Models.DealWithLocalChanges.StashAndReaply)
|
if (PreAction == Models.DealWithLocalChanges.StashAndReaply)
|
||||||
{
|
|
||||||
SetProgressDescription("Adding untracked changes...");
|
|
||||||
var succ = new Commands.Add(_repo.FullPath).Exec();
|
|
||||||
if (succ)
|
|
||||||
{
|
{
|
||||||
SetProgressDescription("Stash local changes");
|
SetProgressDescription("Stash local changes");
|
||||||
succ = new Commands.Stash(_repo.FullPath).Push("CREATE_BRANCH_AUTO_STASH");
|
var succ = new Commands.Stash(_repo.FullPath).Push("CREATE_BRANCH_AUTO_STASH");
|
||||||
}
|
|
||||||
|
|
||||||
if (!succ)
|
if (!succ)
|
||||||
{
|
{
|
||||||
CallUIThread(() => _repo.SetWatcherEnabled(true));
|
CallUIThread(() => _repo.SetWatcherEnabled(true));
|
||||||
|
|
|
@ -133,15 +133,9 @@ namespace SourceGit.ViewModels
|
||||||
if (_repo.WorkingCopyChangesCount > 0)
|
if (_repo.WorkingCopyChangesCount > 0)
|
||||||
{
|
{
|
||||||
if (PreAction == Models.DealWithLocalChanges.StashAndReaply)
|
if (PreAction == Models.DealWithLocalChanges.StashAndReaply)
|
||||||
{
|
|
||||||
SetProgressDescription("Adding untracked changes...");
|
|
||||||
var succ = new Commands.Add(_repo.FullPath).Exec();
|
|
||||||
if (succ)
|
|
||||||
{
|
{
|
||||||
SetProgressDescription("Stash local changes...");
|
SetProgressDescription("Stash local changes...");
|
||||||
succ = new Commands.Stash(_repo.FullPath).Push("PULL_AUTO_STASH");
|
var succ = new Commands.Stash(_repo.FullPath).Push("PULL_AUTO_STASH");
|
||||||
}
|
|
||||||
|
|
||||||
if (!succ)
|
if (!succ)
|
||||||
{
|
{
|
||||||
CallUIThread(() => _repo.SetWatcherEnabled(true));
|
CallUIThread(() => _repo.SetWatcherEnabled(true));
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue