Search in sources :

Example 1 with GitRebaseActionDialog

use of git4idea.rebase.GitRebaseActionDialog in project intellij-community by JetBrains.

the class GitAbstractRebaseAction method chooseRepository.

@Nullable
private GitRepository chooseRepository(@NotNull Project project, @NotNull Collection<GitRepository> repositories) {
    GitRepository firstRepo = assertNotNull(ContainerUtil.getFirstItem(repositories));
    if (repositories.size() == 1)
        return firstRepo;
    ArrayList<VirtualFile> roots = newArrayList(getRootsFromRepositories(repositories));
    GitRebaseActionDialog dialog = new GitRebaseActionDialog(project, getTemplatePresentation().getText(), roots, firstRepo.getRoot());
    dialog.show();
    VirtualFile root = dialog.selectRoot();
    if (root == null)
        return null;
    // TODO avoid root <-> GitRepository double conversion
    return getRepositoryManager(project).getRepositoryForRootQuick(root);
}
Also used : VirtualFile(com.intellij.openapi.vfs.VirtualFile) GitRepository(git4idea.repo.GitRepository) GitRebaseActionDialog(git4idea.rebase.GitRebaseActionDialog) Nullable(org.jetbrains.annotations.Nullable)

Aggregations

VirtualFile (com.intellij.openapi.vfs.VirtualFile)1 GitRebaseActionDialog (git4idea.rebase.GitRebaseActionDialog)1 GitRepository (git4idea.repo.GitRepository)1 Nullable (org.jetbrains.annotations.Nullable)1