[git] IDEA-94378 Hard refresh after stash/unstash, the same as it is done for checkout.

This commit is contained in:
Kirill Likhodedov
2012-11-10 13:32:01 +04:00
parent d2bf18d9da
commit 3c673662ed
4 changed files with 9 additions and 4 deletions
@@ -34,6 +34,7 @@ import com.intellij.openapi.vcs.changes.FilePathsHelper;
import com.intellij.openapi.vcs.versionBrowser.CommittedChangeList;
import com.intellij.openapi.vcs.vfs.AbstractVcsVirtualFile;
import com.intellij.openapi.vfs.LocalFileSystem;
import com.intellij.openapi.vfs.VfsUtil;
import com.intellij.openapi.vfs.VirtualFile;
import com.intellij.util.Consumer;
import com.intellij.util.Function;
@@ -923,4 +924,8 @@ public class GitUtil {
return Collections.emptyMap();
}
}
public static void hardRefresh(VirtualFile dir) {
VfsUtil.markDirtyAndRefresh(true, true, false, dir);
}
}
@@ -19,6 +19,7 @@ import com.intellij.openapi.project.Project;
import com.intellij.openapi.vcs.VcsException;
import com.intellij.openapi.vcs.changes.ChangeListManager;
import com.intellij.openapi.vfs.VirtualFile;
import git4idea.GitUtil;
import git4idea.commands.GitHandlerUtil;
import git4idea.commands.GitLineHandler;
import git4idea.i18n.GitBundle;
@@ -52,7 +53,7 @@ public class GitStash extends GitRepositoryAction {
affectedRoots.add(root);
final GitLineHandler h = d.handler();
GitHandlerUtil.doSynchronously(h, GitBundle.getString("stashing.title"), h.printableCommandLine());
root.refresh(true, true);
GitUtil.hardRefresh(root);
}
/**
@@ -23,7 +23,6 @@ import com.intellij.openapi.util.io.FileUtil;
import com.intellij.openapi.util.text.StringUtil;
import com.intellij.openapi.vcs.VcsException;
import com.intellij.openapi.vcs.changes.Change;
import com.intellij.openapi.vfs.VfsUtil;
import com.intellij.openapi.vfs.VirtualFile;
import com.intellij.util.Function;
import git4idea.GitPlatformFacade;
@@ -247,7 +246,7 @@ abstract class GitBranchOperation {
protected static void refreshRoot(@NotNull GitRepository repository) {
// marking all files dirty, because sometimes FileWatcher is unable to process such a large set of changes that can happen during
// checkout on a large repository: IDEA-89944
VfsUtil.markDirtyAndRefresh(true, true, false, repository.getRoot());
GitUtil.hardRefresh(repository.getRoot());
}
protected void fatalLocalChangesError(@NotNull String reference) {
@@ -407,7 +407,7 @@ public class GitUnstashDialog extends DialogWrapper {
}
});
int rc = GitHandlerUtil.doSynchronously(h, GitBundle.getString("unstash.unstashing"), h.printableCommandLine(), false);
root.refresh(true, true);
GitUtil.hardRefresh(root);
if (conflict.get()) {
boolean conflictsResolved = new UnstashConflictResolver(myProject, root, getSelectedStash()).merge();