Change (@NotNull Project project, @NotNull VirtualFile vcsRoot, @NotNull VcsRevisionNumber thisRevision, @Nullable VcsRevisionNumber parentRevision, @NotNull VcsFileStatusInfo statusInfo) { final ContentRevision before; final ContentRevision after; final String path = statusInfo.getFirstPath(); final FilePath filePath = GitContentRevision.createPath(vcsRoot, path); FileStatus status; switch (statusInfo.getType()) { case NEW -> { before = null; status = FileStatus.ADDED; after = GitContentRevision.createRevision(filePath, thisRevision, project); } case MODIFICATION -> { status = FileStatus.MODIFIED; before = GitContentRevision.createRevision(filePath, parentRevision, project); after = GitContentRevision.createRevision(filePath, thisRevision, project); } case DELETED -> { status = FileStatus.DELETED; before = GitContentRevision.createRevision(filePath, parentRevision, project); after = null; } case MOVED -> { status = FileStatus.MODIFIED; String secondPath = statusInfo.getSecondPath(); final FilePath filePathAfterRename = secondPath == null ? filePath : GitContentRevision.createPath(vcsRoot, secondPath); before = GitContentRevision.createRevision(filePath, parentRevision, project); after = GitContentRevision.createRevision(filePathAfterRename, thisRevision, project); } default -> throw new AssertionError("Unknown file status: " + statusInfo); } return new Change(before, after, status); }