Only set repository.last_build for last build on default branch

Close #318.