Skip to content

[ISSUE]: GitVersion complains about shallow repository in Azure DevOps #4094

@mc0re

Description

@mc0re

Prerequisites

  • I have written a descriptive issue title
  • I have searched issues to ensure it has not already been reported

GitVersion package

AzureDevops task

GitVersion version

5.12.0

Operating system

Windows

What are you seeing?

Just stumbled upon this error in an Azure pipeline executed on a home-made VM. Possibly I lack some setting somewhere.
Error

Running on: 'Azure Pipelines'
Disable Telemetry
Executing GitVersion
Command: git -C C:/agent/_work/1/s rev-parse --is-shallow-repository
C:\agent\externals\git\cmd\git.exe -C C:/agent/_work/1/s rev-parse --is-shallow-repository
true
##[error]The repository is shallow. Consider disabling shallow clones. See https://github.com/GitTools/actions/blob/main/docs/cloning.md for more information.

What is expected?

No error.

Steps to Reproduce

Create a VM in Azure, install the latest GIT and other tools.

Azure pipeline

    steps:
    - checkout: self
      clean: true
      fetchDepth: 0
      fetchTags: true
      submodules: recursive

    - task: gitversion/setup@1
      displayName: Install GitVersion
      inputs:
        versionSpec: $(GitVersionVersion)

    - task: gitversion/execute@1
      displayName: Determine current version
      inputs:
        useConfigFile: true
        configFilePath: ./GitVersion.yml

GitVersionVersion is 5.x

GitVersion.yml

mode: Mainline
branches:
  master:
    regex: ^master$|^main$

RepositoryFixture Test

No response

Output log or link to your CI build (if appropriate).

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions