A repository could have objects but no valid HEAD, causing project.commit to be nil.
project.commit
nil