diff --git a/plugins/git4idea/src/git4idea/actions/GitFetch.java b/plugins/git4idea/src/git4idea/actions/GitFetch.java index 6fdd7424999b..12f6ad919088 100644 --- a/plugins/git4idea/src/git4idea/actions/GitFetch.java +++ b/plugins/git4idea/src/git4idea/actions/GitFetch.java @@ -28,7 +28,6 @@ import git4idea.update.GitFetcher; import org.jetbrains.annotations.NotNull; import java.util.List; -import java.util.Set; public class GitFetch extends GitRepositoryAction { @Override @@ -40,7 +39,6 @@ public class GitFetch extends GitRepositoryAction { protected void perform(@NotNull final Project project, @NotNull final List gitRoots, @NotNull final VirtualFile defaultRoot, - final Set affectedRoots, final List exceptions) throws VcsException { GitVcs.runInBackground(new Task.Backgroundable(project, "Fetching...", true) { @Override diff --git a/plugins/git4idea/src/git4idea/actions/GitMergeAction.java b/plugins/git4idea/src/git4idea/actions/GitMergeAction.java index d6909ed3dc80..d723017b8836 100644 --- a/plugins/git4idea/src/git4idea/actions/GitMergeAction.java +++ b/plugins/git4idea/src/git4idea/actions/GitMergeAction.java @@ -42,7 +42,6 @@ import org.jetbrains.annotations.Nullable; import java.util.ArrayList; import java.util.List; -import java.util.Set; import static git4idea.commands.GitLocalChangesWouldBeOverwrittenDetector.Operation.MERGE; @@ -66,7 +65,6 @@ abstract class GitMergeAction extends GitRepositoryAction { protected void perform(@NotNull final Project project, @NotNull final List gitRoots, @NotNull final VirtualFile defaultRoot, - final Set affectedRoots, final List exceptions) throws VcsException { final DialogState dialogState = displayDialog(project, gitRoots, defaultRoot); if (dialogState == null) { diff --git a/plugins/git4idea/src/git4idea/actions/GitRepositoryAction.java b/plugins/git4idea/src/git4idea/actions/GitRepositoryAction.java index d708885a3c14..ebbf5b651aa7 100644 --- a/plugins/git4idea/src/git4idea/actions/GitRepositoryAction.java +++ b/plugins/git4idea/src/git4idea/actions/GitRepositoryAction.java @@ -35,9 +35,7 @@ import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; import java.util.ArrayList; -import java.util.HashSet; import java.util.List; -import java.util.Set; import static com.intellij.util.ObjectUtils.notNull; @@ -55,11 +53,10 @@ public abstract class GitRepositoryAction extends DumbAwareAction { if (roots == null) return; final VirtualFile defaultRoot = getDefaultRoot(project, roots, e.getData(CommonDataKeys.VIRTUAL_FILE_ARRAY)); - final Set affectedRoots = new HashSet<>(); List exceptions = new ArrayList<>(); try { - perform(project, roots, defaultRoot, affectedRoots, exceptions); + perform(project, roots, defaultRoot, exceptions); } catch (VcsException ex) { exceptions.add(ex); @@ -131,14 +128,12 @@ public abstract class GitRepositoryAction extends DumbAwareAction { * @param project a context project * @param gitRoots a git roots that affect the current project (sorted by {@link VirtualFile#getPresentableUrl()}) * @param defaultRoot a guessed default root (based on the currently selected file list) - * @param affectedRoots a set of roots affected by the action * @param exceptions a list of exceptions from running git * @throws VcsException if there is a problem with running git (this exception is considered to be added to the end of the exception list) */ protected abstract void perform(@NotNull Project project, @NotNull List gitRoots, @NotNull VirtualFile defaultRoot, - final Set affectedRoots, List exceptions) throws VcsException; @Override diff --git a/plugins/git4idea/src/git4idea/actions/GitResetHead.java b/plugins/git4idea/src/git4idea/actions/GitResetHead.java index be23f09a8fff..653c1efb3e47 100644 --- a/plugins/git4idea/src/git4idea/actions/GitResetHead.java +++ b/plugins/git4idea/src/git4idea/actions/GitResetHead.java @@ -21,7 +21,6 @@ import com.intellij.openapi.project.Project; import com.intellij.openapi.vcs.VcsException; import com.intellij.openapi.vfs.VfsUtil; import com.intellij.openapi.vfs.VirtualFile; -import com.intellij.util.ArrayUtil; import git4idea.GitUtil; import git4idea.commands.GitHandlerUtil; import git4idea.commands.GitLineHandler; @@ -31,7 +30,6 @@ import git4idea.ui.GitResetDialog; import org.jetbrains.annotations.NotNull; import java.util.List; -import java.util.Set; /** * The reset action @@ -51,14 +49,12 @@ public class GitResetHead extends GitRepositoryAction { protected void perform(@NotNull Project project, @NotNull List gitRoots, @NotNull VirtualFile defaultRoot, - Set affectedRoots, List exceptions) throws VcsException { GitResetDialog d = new GitResetDialog(project, gitRoots, defaultRoot); if (!d.showAndGet()) { return; } GitLineHandler h = d.handler(); - affectedRoots.add(d.getGitRoot()); AccessToken token = DvcsUtil.workingTreeChangeStarted(project); try { GitHandlerUtil.doSynchronously(h, GitBundle.getString("resetting.title"), h.printableCommandLine()); @@ -68,7 +64,7 @@ public class GitResetHead extends GitRepositoryAction { } GitRepositoryManager manager = GitUtil.getRepositoryManager(project); manager.updateRepository(d.getGitRoot()); - VfsUtil.markDirtyAndRefresh(true, true, false, ArrayUtil.toObjectArray(affectedRoots, VirtualFile.class)); + VfsUtil.markDirtyAndRefresh(true, true, false, d.getGitRoot()); showErrors(project, getActionName(), exceptions); } } diff --git a/plugins/git4idea/src/git4idea/actions/GitStash.java b/plugins/git4idea/src/git4idea/actions/GitStash.java index bcca452ad7f0..3de0b338a525 100644 --- a/plugins/git4idea/src/git4idea/actions/GitStash.java +++ b/plugins/git4idea/src/git4idea/actions/GitStash.java @@ -29,7 +29,6 @@ import git4idea.ui.GitStashDialog; import org.jetbrains.annotations.NotNull; import java.util.List; -import java.util.Set; /** * Git stash action @@ -42,7 +41,6 @@ public class GitStash extends GitRepositoryAction { protected void perform(@NotNull final Project project, @NotNull final List gitRoots, @NotNull final VirtualFile defaultRoot, - final Set affectedRoots, final List exceptions) throws VcsException { final ChangeListManager changeListManager = ChangeListManager.getInstance(project); if (changeListManager.isFreezedWithNotification("Can not stash changes now")) return; @@ -51,7 +49,6 @@ public class GitStash extends GitRepositoryAction { return; } VirtualFile root = d.getGitRoot(); - affectedRoots.add(root); final GitLineHandler h = d.handler(); AccessToken token = DvcsUtil.workingTreeChangeStarted(project); try { diff --git a/plugins/git4idea/src/git4idea/actions/GitTag.java b/plugins/git4idea/src/git4idea/actions/GitTag.java index 096dd11be3a6..50a986ed7534 100644 --- a/plugins/git4idea/src/git4idea/actions/GitTag.java +++ b/plugins/git4idea/src/git4idea/actions/GitTag.java @@ -23,7 +23,6 @@ import git4idea.ui.GitTagDialog; import org.jetbrains.annotations.NotNull; import java.util.List; -import java.util.Set; /** * Git "tag" action @@ -44,7 +43,6 @@ public class GitTag extends GitRepositoryAction { protected void perform(@NotNull final Project project, @NotNull final List gitRoots, @NotNull final VirtualFile defaultRoot, - final Set affectedRoots, final List exceptions) throws VcsException { GitTagDialog d = new GitTagDialog(project, gitRoots, defaultRoot); if (!d.showAndGet()) { diff --git a/plugins/git4idea/src/git4idea/actions/GitUnstash.java b/plugins/git4idea/src/git4idea/actions/GitUnstash.java index dd3ab1bd0657..41e086979f90 100644 --- a/plugins/git4idea/src/git4idea/actions/GitUnstash.java +++ b/plugins/git4idea/src/git4idea/actions/GitUnstash.java @@ -24,7 +24,6 @@ import git4idea.ui.GitUnstashDialog; import org.jetbrains.annotations.NotNull; import java.util.List; -import java.util.Set; /** * Git unstash action @@ -45,7 +44,6 @@ public class GitUnstash extends GitRepositoryAction { protected void perform(@NotNull final Project project, @NotNull final List gitRoots, @NotNull final VirtualFile defaultRoot, - final Set affectedRoots, final List exceptions) throws VcsException { final ChangeListManager changeListManager = ChangeListManager.getInstance(project); if (changeListManager.isFreezedWithNotification("Can not unstash changes now")) return;