Updating git latest_commit method to check for nil results