Returns Commit if this data is Commit, otherwise null.
Commit? get commitOrNull => isCommit ? commit : null;