Commit count is not correct after default branch changes

Summary

Commit count is not correct when default branch is changed.

Steps to reproduce

  1. Change default branch
  2. Verify number of commits is incorrect

What is the current bug behavior?

Number of commits displayed is not correct for selected branch

What is the expected correct behavior?

Number of commits displayed should match actual number of commits for selected branch

Possible fixes

https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/26473/diffs