Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Keppler2019-06-30 13:41:58 -0400
committerMichael Keppler2019-07-03 12:14:50 -0400
commit8ea29e491aa59ee692d982cb517b61e92066dac5 (patch)
tree9aea364ac66729e9b147bf19a657633296bc8b31
parent6416f4fea13b7aec568a8a2d44d5ef3e3bd16302 (diff)
downloadegit-8ea29e491aa59ee692d982cb517b61e92066dac5.tar.gz
egit-8ea29e491aa59ee692d982cb517b61e92066dac5.tar.xz
egit-8ea29e491aa59ee692d982cb517b61e92066dac5.zip
Allow cancelling multi repository checkout
Only cancel the git operation. The Eclipse project refresh must be done even when the checkout was cancelled. Change-Id: I19c07f55e91f58984deb7fe9d27082adcaef191f Signed-off-by: Michael Keppler <Michael.Keppler@gmx.de>
-rw-r--r--org.eclipse.egit.core/src/org/eclipse/egit/core/op/BranchOperation.java18
1 files changed, 14 insertions, 4 deletions
diff --git a/org.eclipse.egit.core/src/org/eclipse/egit/core/op/BranchOperation.java b/org.eclipse.egit.core/src/org/eclipse/egit/core/op/BranchOperation.java
index da20c9f48..b8986d2b0 100644
--- a/org.eclipse.egit.core/src/org/eclipse/egit/core/op/BranchOperation.java
+++ b/org.eclipse.egit.core/src/org/eclipse/egit/core/op/BranchOperation.java
@@ -127,10 +127,20 @@ public class BranchOperation implements IEGitOperation {
SubMonitor progress = SubMonitor.convert(pm,
numberOfRepositories * 2);
for (Repository repository : repositories) {
- CheckoutResult result = checkoutRepository(repository,
- progress.newChild(1), numberOfRepositories > 1);
- if (result.getStatus() == Status.NONDELETED) {
- retryDelete(repository, result.getUndeletedList());
+ CheckoutResult result;
+ if (pm.isCanceled()) {
+ // don't break from the loop, the result map must be
+ // filled
+ result = CheckoutResult.NOT_TRIED_RESULT;
+ }
+ else {
+ result = checkoutRepository(repository,
+ progress.newChild(1),
+ numberOfRepositories > 1);
+ if (result.getStatus() == Status.NONDELETED) {
+ retryDelete(repository,
+ result.getUndeletedList());
+ }
}
results.put(repository, result);
}

Back to the top