Wrong commit count in project overview when default branch is not "master"

Summary

When the default branch is not master, the project overview still shows the commits from master.

Steps to reproduce

create branch with higher

Example Project

https://gitlab.com/bkc/reproduce-commit-count-bug/

What is the current bug behavior?

It shows Commits (1)

What is the expected correct behavior?

It should show Commits (2)

Relevant logs and/or screenshots

Default branch set to master image image

Default branch set to license image image

Output of checks

This bug happens on GitLab.com

Possible fixes

(If you can, link to the line of code that might be responsible for the problem)