Returns RepoRef if this data is RepoRef, otherwise null.
RepoRef? get repoRefOrNull => isRepoRef ? repoRef : null;