Fix branch status performance very poor when pygit is not installed