fix<Stash>: fix stash failed when there's too many files to be stashed

This commit is contained in:
leo 2023-10-10 16:59:47 +08:00
parent 905531f2db
commit ccb3c07064
4 changed files with 53 additions and 31 deletions

View file

@ -67,7 +67,7 @@ namespace SourceGit.Views.Popups {
var changes = new Commands.LocalChanges(repo).Result();
if (changes.Count > 0) {
if (AutoStash) {
if (!new Commands.Stash(repo).Push(changes, "NEWBRANCH_AUTO_STASH")) {
if (!new Commands.Stash(repo).Push(changes, "NEWBRANCH_AUTO_STASH", true)) {
return false;
}
} else {

View file

@ -29,7 +29,8 @@ namespace SourceGit.Views.Popups {
return Task.Run(() => {
Models.Watcher.SetEnabled(repo, false);
if (changes == null || changes.Count == 0) {
var bFull = changes == null || changes.Count == 0;
if (bFull) {
changes = new Commands.LocalChanges(repo).Result();
}
@ -42,7 +43,7 @@ namespace SourceGit.Views.Popups {
}
}
if (jobs.Count > 0) new Commands.Stash(repo).Push(changes, message);
if (jobs.Count > 0) new Commands.Stash(repo).Push(changes, message, bFull);
Models.Watcher.SetEnabled(repo, true);
return true;
});