From 51538a0ef218bb3893f4d15ab2552908fdd2ab20 Mon Sep 17 00:00:00 2001 From: Kirill Likhodedov Date: Mon, 18 Aug 2014 18:32:25 +0400 Subject: [PATCH] [git] handle local changes overwritten error during github rebase --- .../org/jetbrains/plugins/github/GithubRebaseAction.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/plugins/github/src/org/jetbrains/plugins/github/GithubRebaseAction.java b/plugins/github/src/org/jetbrains/plugins/github/GithubRebaseAction.java index bfceb0ceec39..719f8b956432 100644 --- a/plugins/github/src/org/jetbrains/plugins/github/GithubRebaseAction.java +++ b/plugins/github/src/org/jetbrains/plugins/github/GithubRebaseAction.java @@ -48,6 +48,7 @@ import org.jetbrains.plugins.github.util.*; import java.io.IOException; import java.util.Collections; +import static git4idea.commands.GitLocalChangesWouldBeOverwrittenDetector.Operation.CHECKOUT; import static org.jetbrains.plugins.github.util.GithubUtil.setVisibleEnabled; /** @@ -256,7 +257,9 @@ public class GithubRebaseAction extends DumbAwareAction { final GitUntrackedFilesOverwrittenByOperationDetector untrackedFilesDetector = new GitUntrackedFilesOverwrittenByOperationDetector(root); + final GitLocalChangesWouldBeOverwrittenDetector localChangesDetector = new GitLocalChangesWouldBeOverwrittenDetector(root, CHECKOUT); handler.addLineListener(untrackedFilesDetector); + handler.addLineListener(localChangesDetector); GitTask pullTask = new GitTask(project, handler, "Rebasing from upstream/master"); pullTask.setProgressIndicator(indicator); @@ -271,7 +274,8 @@ public class GithubRebaseAction extends DumbAwareAction { @Override protected void onFailure() { - GitUpdateResult result = rebaser.handleRebaseFailure(handler, root, rebaseConflictDetector, untrackedFilesDetector); + GitUpdateResult result = rebaser.handleRebaseFailure(handler, root, rebaseConflictDetector, + untrackedFilesDetector, localChangesDetector); repositoryManager.updateRepository(root); if (result == GitUpdateResult.NOTHING_TO_UPDATE || result == GitUpdateResult.SUCCESS ||