mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
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:
@@ -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;
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user