Dedicated method for counting commits between refs
Corresponding gitlab_git merge request: gitlab_git!66 (merged) Issue that lead to these changes: https://gitlab.com/gitlab-org/gitlab-ce/issues/12619
Corresponding gitlab_git merge request: gitlab_git!66 (merged) Issue that lead to these changes: https://gitlab.com/gitlab-org/gitlab-ce/issues/12619