Fix the logic of repository detail view