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.
This commit is contained in:
Kirill Likhodedov
2011-03-10 19:09:02 +03:00
parent 06cb6a6d50
commit 68dacb79ac
@@ -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;