Fixed git branch count issue, which arises after a git gc