mirror of
https://fastgit.cc/github.com/sourcegit-scm/sourcegit
synced 2026-04-23 10:22:13 +08:00
optimize<WorkingCopyChanges>: run as stage/unstage all if all changes selected
This commit is contained in:
@@ -371,7 +371,7 @@ namespace SourceGit.Views.Widgets {
|
||||
private async void DoStage(List<string> files) {
|
||||
IsStaging = true;
|
||||
Models.Watcher.SetEnabled(repo, false);
|
||||
if (files == null || files.Count == 0) {
|
||||
if (files == null || files.Count == 0 || files.Count == Changes.Count) {
|
||||
await Task.Run(() => new Commands.Add(repo).Exec());
|
||||
} else {
|
||||
for (int i = 0; i < files.Count; i += 10) {
|
||||
@@ -709,7 +709,7 @@ namespace SourceGit.Views.Widgets {
|
||||
#region STAGED
|
||||
private async void DoUnstage(List<string> files) {
|
||||
Models.Watcher.SetEnabled(repo, false);
|
||||
if (files == null || files.Count == 0) {
|
||||
if (files == null || files.Count == 0 || files.Count == Changes.Count) {
|
||||
await Task.Run(() => new Commands.Reset(repo).Exec());
|
||||
} else {
|
||||
for (int i = 0; i < files.Count; i += 10) {
|
||||
|
||||
Reference in New Issue
Block a user