Simply VFS events processing in GitUntrackedFilesHolder

No need to process VFileCopyEvent differently.

VFileCopyEvent.getFile() returns file in its current location.
If the file was already moved since the event was posted,
copyEvent.getNewParent().findChild() would either return null,
or return some other unrelated file.
If the file was not moved, the calls are equivalent.
This commit is contained in:
Kirill Likhodedov
2017-10-17 17:43:05 +03:00
parent ba5d32a3f8
commit bb22c50726
@@ -300,13 +300,9 @@ public class GitUntrackedFilesHolder implements Disposable, AsyncVfsEventsListen
if (event instanceof VFileCreateEvent) {
return ((VFileCreateEvent)event).getParent().isValid() ? event.getFile() : null;
}
else if (event instanceof VFileDeleteEvent || event instanceof VFileMoveEvent || isRename(event)) {
if (event instanceof VFileCopyEvent || event instanceof VFileDeleteEvent || event instanceof VFileMoveEvent || isRename(event)) {
return event.getFile();
}
else if (event instanceof VFileCopyEvent) {
VFileCopyEvent copyEvent = (VFileCopyEvent) event;
return copyEvent.getNewParent().findChild(copyEvent.getNewChildName());
}
return null;
});
}