We are building an iOS app using fastlane/gym. The target has as a dependency a script which does buildnum=$(git rev-list HEAD --count) and assigns that to the build number in Info.plist. For some reason, the resulting ipa has buildnumber 20 when built on circleCI server but 148 when I build it locally.
I have checked that it really does read the number of commits - when I add one commit, it changes to 21 on circleCI and 149 on my machine. So I am confident that I have pinpointed the issue, git rev-list HEAD --count must be giving different results on circleCI server. Any idea why this might be happening?