Azure DevOps Yaml Pipline gitversion/execute failing ObjectHandle.op_Implicit(ObjectHandle handle) in /_/LibGit2Sharp/Core/Handles/Objects.cs:line 509

Viewed 20

Getting error when run task gitversion/execute on azure devops yaml pipeline An unexpected error occurred: System.NullReferenceException: Object reference not set to an instance of an object. at LibGit2Sharp.Core.Handles.ObjectHandle.op_Implicit(ObjectHandle handle) in /_/LibGit2Sharp/Core/Handles/Objects.cs:line 509 at LibGit2Sharp.Core.Proxy.git_commit_author(ObjectHandle obj) in /_/LibGit2Sharp/Core/Proxy.cs:line 289 at comming from ##[debug]fetchDepth=1 with not option to setup in yaml, as this was change as default value for Microsoft.

1 Answers

Option to setup fetch is hidden in ADO under pipeline Edit button -> Triggers -> enter image description here

Or use

variables:
  Agent.Source.Git.ShallowFetchDepth: 1

or if the repository is also checkout as dedicated task

steps:
  - checkout: self
    fetchDepth: 1
    clean: true```
Related