ShelvedChange (@NotNull Project project, @NotNull Path patchPath, @NotNull FilePatch patch) { String beforeName = patch.getBeforeName(); String afterName = patch.getAfterName(); if (beforeName == null || afterName == null) { LOG.warn("Failed to parse the file patch: [" + patchPath + "]:" + patch); return null; } FileStatus status; if (patch.isNewFile()) { status = FileStatus.ADDED; } else if (patch.isDeletedFile()) { status = FileStatus.DELETED; } else { status = FileStatus.MODIFIED; } return ShelvedChange.create(project, patchPath, beforeName, afterName, status); }