Return error if no commits