mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-21 17:52:27 +07:00
do not check out current branch
This commit is contained in:
@@ -76,6 +76,23 @@ public abstract class VcsTaskHandler {
|
||||
public int compareTo(TaskInfo o) {
|
||||
return Comparing.compare(myBranch, o.myBranch);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (this == o) return true;
|
||||
if (o == null || getClass() != o.getClass()) return false;
|
||||
|
||||
TaskInfo info = (TaskInfo)o;
|
||||
|
||||
if (myRemote != info.myRemote) return false;
|
||||
if (!myBranch.equals(info.myBranch)) return false;
|
||||
return myRepositories.size() == info.myRepositories.size() && myRepositories.containsAll(info.myRepositories);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return myBranch.hashCode();
|
||||
}
|
||||
}
|
||||
|
||||
private static final ExtensionPointName<VcsTaskHandler> EXTENSION_POINT_NAME = ExtensionPointName.create("com.intellij.vcs.taskHandler");
|
||||
|
||||
@@ -20,7 +20,6 @@ import com.intellij.openapi.project.Project;
|
||||
import com.intellij.openapi.ui.ComboBox;
|
||||
import com.intellij.openapi.ui.Messages;
|
||||
import com.intellij.openapi.ui.ValidationInfo;
|
||||
import com.intellij.openapi.util.Condition;
|
||||
import com.intellij.openapi.vcs.VcsTaskHandler;
|
||||
import com.intellij.tasks.LocalTask;
|
||||
import com.intellij.tasks.Task;
|
||||
@@ -169,7 +168,8 @@ public class VcsOpenTaskPanel extends TaskDialogPanel {
|
||||
if (myCreateBranch.isSelected()) {
|
||||
VcsTaskHandler.TaskInfo branchFrom = (VcsTaskHandler.TaskInfo)myBranchFrom.getSelectedItem();
|
||||
Runnable createBranch = () -> myTaskManager.createBranch(localTask, myPreviousTask, myBranchName.getText(), branchFrom);
|
||||
if (branchFrom != null) {
|
||||
VcsTaskHandler.TaskInfo[] current = myVcsTaskHandler.getCurrentTasks();
|
||||
if (branchFrom != null && (current.length == 0 || !current[0].equals(branchFrom))) {
|
||||
myVcsTaskHandler.switchToTask(branchFrom, createBranch);
|
||||
}
|
||||
else {
|
||||
|
||||
Reference in New Issue
Block a user