79541618

Date: 2025-03-28 13:59:20
Score: 0.5
Natty:
Report link

Turns out ADO pipelines makes a shallow clone of the repo, which means that there's only 1 commit, thus causing `git rev-list --count HEAD` to return 1.

To fix it, force the pipeline to fetch everything:

    - checkout: self
      fetchDepth: 0
      persistCredentials: true
      clean: false
      displayName: Checkout
    - script: |
          git rev-list --count HEAD
      displayName: "git count"
Reasons:
  • Has code block (-0.5):
  • Self-answer (0.5):
  • Low reputation (0.5):
Posted by: MikkelT