From 68dacb79ac02114c25f3c3581a059d784e6cdbbf Mon Sep 17 00:00:00 2001 From: Kirill Likhodedov Date: Sun, 27 Feb 2011 13:38:37 +0300 Subject: [PATCH] git update: check if update is possible under try-block checkRebaseInProgress and other checks not only check, but also show the merge tool, change code, continue rebase, etc. Thus block reloading project on external change for these operations. --- .../git4idea/src/git4idea/update/GitUpdateProcess.java | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/plugins/git4idea/src/git4idea/update/GitUpdateProcess.java b/plugins/git4idea/src/git4idea/update/GitUpdateProcess.java index c7fe916571a7..32320c798675 100644 --- a/plugins/git4idea/src/git4idea/update/GitUpdateProcess.java +++ b/plugins/git4idea/src/git4idea/update/GitUpdateProcess.java @@ -75,14 +75,15 @@ public class GitUpdateProcess { */ public boolean update() { LOG.info("update started"); - // check if update is possible - if (checkRebaseInProgress() || checkMergeInProgress() || checkUnmergedFiles()) { return false; } - if (!allTrackedBranchesConfigured()) { return false; } - final GitChangesSaver saver = GitChangesSaver.getSaver(myProject, myProgressIndicator, "Uncommitted changes before update operation at " + DateFormatUtil.formatDateTime(Clock.getTime())); + myProjectManager.blockReloadingProjectOnExternalChanges(); try { + // check if update is possible + if (checkRebaseInProgress() || checkMergeInProgress() || checkUnmergedFiles()) { return false; } + if (!allTrackedBranchesConfigured()) { return false; } + saver.saveLocalChanges(); // update each root boolean incomplete = false;