commit: fix a segfault when displaying a commit with unreachable parents