mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
[git] IDEA-71600 better identify conflict during unstash
This commit is contained in:
@@ -16,39 +16,41 @@
|
||||
package git4idea.commands;
|
||||
|
||||
import com.intellij.openapi.util.Key;
|
||||
import com.intellij.openapi.util.text.StringUtil;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
/**
|
||||
* @author Kirill Likhodedov
|
||||
*/
|
||||
public class GitSimpleEventDetector implements GitLineHandlerListener {
|
||||
|
||||
private final Event myEvent;
|
||||
@NotNull private final Event myEvent;
|
||||
private boolean myHappened;
|
||||
|
||||
public enum Event {
|
||||
CHERRY_PICK_CONFLICT("fter resolving the conflicts"), // a is uppercase in 1.7.0.5 and lowercase in 1.7.9.2
|
||||
CHERRY_PICK_CONFLICT("after resolving the conflicts"),
|
||||
LOCAL_CHANGES_OVERWRITTEN_BY_CHERRY_PICK("would be overwritten by merge"),
|
||||
UNMERGED_PREVENTING_CHECKOUT("you need to resolve your current index first"),
|
||||
UNMERGED_PREVENTING_MERGE("is not possible because you have unmerged files"),
|
||||
BRANCH_NOT_FULLY_MERGED("is not fully merged"),
|
||||
MERGE_CONFLICT("Automatic merge failed; fix conflicts and then commit the result"),
|
||||
MERGE_CONFLICT_ON_UNSTASH("Merge conflict"),
|
||||
MERGE_CONFLICT_ON_UNSTASH("conflict"),
|
||||
ALREADY_UP_TO_DATE("Already up-to-date");
|
||||
|
||||
private final String myDetectionString;
|
||||
|
||||
private Event(String detectionString) {
|
||||
Event(@NotNull String detectionString) {
|
||||
myDetectionString = detectionString;
|
||||
}
|
||||
}
|
||||
|
||||
public GitSimpleEventDetector(Event event) {
|
||||
public GitSimpleEventDetector(@NotNull Event event) {
|
||||
myEvent = event;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onLineAvailable(String line, Key outputType) {
|
||||
if (line.contains(myEvent.myDetectionString)) {
|
||||
public void onLineAvailable(@NotNull String line, Key outputType) {
|
||||
if (StringUtil.containsIgnoreCase(line, myEvent.myDetectionString)) {
|
||||
myHappened = true;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user