Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMax Hohenegger2019-07-28 11:18:38 -0400
committerMichael Keppler2019-08-21 02:12:15 -0400
commitf9c82928f45f5e9ab33ab04a08904e1b6d2ebfa6 (patch)
tree7cfd002d9d36482b12c3c0ea28ee65ecc5d3cf27 /org.eclipse.egit.ui
parenta3cbbff0ea6af88f8b2db463633cdd0fe9c9b026 (diff)
downloadegit-f9c82928f45f5e9ab33ab04a08904e1b6d2ebfa6.tar.gz
egit-f9c82928f45f5e9ab33ab04a08904e1b6d2ebfa6.tar.xz
egit-f9c82928f45f5e9ab33ab04a08904e1b6d2ebfa6.zip
Fix silent failure on conflicting checkout after branch creation.
* Minor changes in BranchOperationUI to re-use checkout result handling. * Add UI test because the issue is tedious to reproduce, and depends on proper synchronization with the Job and the Display thread. Bug 549612 Change-Id: I616b975f5eff881c6cc3455649ec7dd7a9bd293f Signed-off-by: Max Hohenegger <eclipse@hohenegger.eu>
Diffstat (limited to 'org.eclipse.egit.ui')
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/branch/BranchOperationUI.java13
1 files changed, 10 insertions, 3 deletions
diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/branch/BranchOperationUI.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/branch/BranchOperationUI.java
index b8c559b5b..14e4f3e98 100644
--- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/branch/BranchOperationUI.java
+++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/branch/BranchOperationUI.java
@@ -400,7 +400,7 @@ public class BranchOperationUI {
Repository repo = repositories[0];
CheckoutResult result = results.get(repo);
handleSingleRepositoryCheckoutOperationResult(repo,
- result);
+ result, target);
} else {
handleMultipleRepositoryCheckoutError(results);
}
@@ -418,8 +418,15 @@ public class BranchOperationUI {
.anyMatch(RepositoryUtil::isDetachedHead);
}
- private void handleSingleRepositoryCheckoutOperationResult(
- Repository repository, CheckoutResult result) {
+ /**
+ * @param repository
+ * @param result
+ * Result of previous attempt to check out branch.
+ * @param target
+ * Name of the branch to be checked out.
+ */
+ public static void handleSingleRepositoryCheckoutOperationResult(
+ Repository repository, CheckoutResult result, String target) {
if (result.getStatus() == CheckoutResult.Status.CONFLICTS) {
PlatformUI.getWorkbench().getDisplay().asyncExec(() -> {

Back to the top