[vcs] Reuse the VirtualFile instead of creating FilePathImpl on File

Relates to IDEA-119996
This commit is contained in:
Kirill Likhodedov
2014-04-22 15:50:07 +04:00
parent c9a1c11f9c
commit 9c69111454
@@ -504,7 +504,8 @@ public class TreeModelBuilder {
ChangesBrowserNode parentNode = myFoldersCache.get(parentPath.getKey());
if (parentNode == null) {
parentNode = ChangesBrowserNode.create(myProject, new FilePathImpl(new File(parentPath.getPath()), true));
FilePathImpl filePath = parentPath.getVf() == null ? new FilePathImpl(new File(parentPath.getPath()), true) : new FilePathImpl(parentPath.getVf());
parentNode = ChangesBrowserNode.create(myProject, filePath);
ChangesBrowserNode grandPa = getParentNodeFor(parentPath, policy, rootNode);
model.insertNodeInto(parentNode, grandPa, grandPa.getChildCount());
myFoldersCache.put(parentPath.getKey(), parentNode);