Search in sources :

Example 1 with GitResetDialog

use of git4idea.ui.GitResetDialog in project intellij-community by JetBrains.

the class GitResetHead method perform.

/**
   * {@inheritDoc}
   */
protected void perform(@NotNull Project project, @NotNull List<VirtualFile> gitRoots, @NotNull VirtualFile defaultRoot) {
    GitResetDialog d = new GitResetDialog(project, gitRoots, defaultRoot);
    if (!d.showAndGet()) {
        return;
    }
    GitLineHandler h = d.handler();
    AccessToken token = DvcsUtil.workingTreeChangeStarted(project);
    try {
        GitHandlerUtil.doSynchronously(h, GitBundle.getString("resetting.title"), h.printableCommandLine());
    } finally {
        token.finish();
    }
    GitRepositoryManager manager = GitUtil.getRepositoryManager(project);
    manager.updateRepository(d.getGitRoot());
    VfsUtil.markDirtyAndRefresh(true, true, false, d.getGitRoot());
    if (!h.errors().isEmpty()) {
        showErrors(project, getActionName(), h.errors());
    }
}
Also used : GitLineHandler(git4idea.commands.GitLineHandler) GitResetDialog(git4idea.ui.GitResetDialog) AccessToken(com.intellij.openapi.application.AccessToken) GitRepositoryManager(git4idea.repo.GitRepositoryManager)

Aggregations

AccessToken (com.intellij.openapi.application.AccessToken)1 GitLineHandler (git4idea.commands.GitLineHandler)1 GitRepositoryManager (git4idea.repo.GitRepositoryManager)1 GitResetDialog (git4idea.ui.GitResetDialog)1