[git] Count the number of commits on a Git branch