From 11dd0242bfd9fb35e64225ddfa8b5cd97e583772 Mon Sep 17 00:00:00 2001 From: Constantine Plotnikov Date: Tue, 6 Oct 2009 18:28:28 +0400 Subject: [PATCH] git4idea: Show message box if autounstash fails --- .../src/git4idea/update/GitUpdateEnvironment.java | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/plugins/git4idea/src/git4idea/update/GitUpdateEnvironment.java b/plugins/git4idea/src/git4idea/update/GitUpdateEnvironment.java index e68602cf9929..8184a2c74206 100644 --- a/plugins/git4idea/src/git4idea/update/GitUpdateEnvironment.java +++ b/plugins/git4idea/src/git4idea/update/GitUpdateEnvironment.java @@ -47,6 +47,7 @@ import git4idea.commands.GitLineHandlerAdapter; import git4idea.config.GitVcsSettings; import git4idea.i18n.GitBundle; import git4idea.merge.MergeChangeCollector; +import git4idea.ui.GitUIUtil; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; @@ -230,7 +231,17 @@ public class GitUpdateEnvironment implements UpdateEnvironment { } finally { if (stashCreated) { - GitStashUtils.popLastStash(myProject, root); + try { + GitStashUtils.popLastStash(myProject, root); + } + catch (final VcsException ue) { + exceptions.add(ue); + UIUtil.invokeAndWaitIfNeeded(new Runnable() { + public void run() { + GitUIUtil.showOperationError(myProject, ue, "Auto-unstash"); + } + }); + } } } }