use of git4idea.commands.GitHandler in project intellij-community by JetBrains.
the class GitVFSListener method performForceMove.
private void performForceMove(@NotNull List<MovedFileInfo> files) {
Map<FilePath, MovedFileInfo> filesToMove = map2Map(files, (info) -> Pair.create(VcsUtil.getFilePath(info.myNewPath), info));
Set<File> toRefresh = newHashSet();
performBackgroundOperation(filesToMove.keySet(), "Moving Files...", new LongOperationPerRootExecutor() {
@Override
public void execute(@NotNull VirtualFile root, @NotNull List<FilePath> files) throws VcsException {
for (FilePath file : files) {
GitHandler h = new GitSimpleHandler(myProject, root, GitCommand.MV);
MovedFileInfo info = filesToMove.get(file);
h.addParameters("-f", info.myOldPath, info.myNewPath);
h.runInCurrentThread(null);
toRefresh.add(new File(info.myOldPath));
toRefresh.add(new File(info.myNewPath));
}
}
@Override
public Collection<File> getFilesToRefresh() {
return toRefresh;
}
});
}
Aggregations