mirror of
https://github.com/sourcegit-scm/sourcegit.git
synced 2024-11-01 13:13:21 -07:00
optimize<WorkingCopyChanges>: run as stage/unstage all if all changes selected
This commit is contained in:
parent
cd934349aa
commit
de75f5010b
1 changed files with 2 additions and 2 deletions
|
@ -371,7 +371,7 @@ namespace SourceGit.Views.Widgets {
|
||||||
private async void DoStage(List<string> files) {
|
private async void DoStage(List<string> files) {
|
||||||
IsStaging = true;
|
IsStaging = true;
|
||||||
Models.Watcher.SetEnabled(repo, false);
|
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());
|
await Task.Run(() => new Commands.Add(repo).Exec());
|
||||||
} else {
|
} else {
|
||||||
for (int i = 0; i < files.Count; i += 10) {
|
for (int i = 0; i < files.Count; i += 10) {
|
||||||
|
@ -709,7 +709,7 @@ namespace SourceGit.Views.Widgets {
|
||||||
#region STAGED
|
#region STAGED
|
||||||
private async void DoUnstage(List<string> files) {
|
private async void DoUnstage(List<string> files) {
|
||||||
Models.Watcher.SetEnabled(repo, false);
|
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());
|
await Task.Run(() => new Commands.Reset(repo).Exec());
|
||||||
} else {
|
} else {
|
||||||
for (int i = 0; i < files.Count; i += 10) {
|
for (int i = 0; i < files.Count; i += 10) {
|
||||||
|
|
Loading…
Reference in a new issue