greenkeeper-lockfile icon indicating copy to clipboard operation
greenkeeper-lockfile copied to clipboard

Broken gitHelpers.getNumberOfCommitsOnBranch on CircleCI

Open patkub opened this issue 6 years ago • 1 comments

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 avatar Apr 20 '18 00:04 patkub

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

patkub avatar Apr 20 '18 01:04 patkub