greenkeeperio / greenkeeper-lockfile

:lock: Your lockfile, up to date, all the time
https://greenkeeper.io
183 stars 73 forks source link

Broken gitHelpers.getNumberOfCommitsOnBranch on CircleCI #144

Open patkub opened 6 years ago

patkub commented 6 years ago

gitHelpers.getNumberOfCommitsOnBranch does not work on CircleCI.

The refactoring of gitHelpers.getNumberOfCommitsOnBranch in https://github.com/greenkeeperio/greenkeeper-lockfile/pull/35 changed its output on CircleCI. Test: https://github.com/patkub/test-gk-lock-git-helpers/blob/master/index.js

On a greenkeeper branch, both methods fail and return 0. CircleCI build: https://circleci.com/gh/patkub/test-gk-lock-git-helpers/35

Number of commits on branch: 0
Number of commits on branch (old method): 0

But, on the master branch, the old method properly detects the number of commits, while the new method returns 0. CircleCI build: https://circleci.com/gh/patkub/test-gk-lock-git-helpers/33

Number of commits on branch: 0
Number of commits on branch (old method): 15

The old method prior to https://github.com/greenkeeperio/greenkeeper-lockfile/pull/35 was https://github.com/greenkeeperio/greenkeeper-lockfile/blob/e2e41a735e623af3ba28267ae89cce982caeab80/lib/git-helpers.js#L6-L14

Current method is: https://github.com/greenkeeperio/greenkeeper-lockfile/blob/6a1068a50377bd4b444e7b00b3aab433b687bd52/lib/git-helpers.js#L8-L16

patkub commented 6 years ago

@nevir Any thoughts on how to fix this for CircleCI and not potentially break other CIs?