RamblingCookieMonster / BuildHelpers

Helper functions for PowerShell CI/CD scenarios
MIT License
214 stars 47 forks source link

Invoke-Git : warning: refname 'x' is ambiguous. #128

Open neopsyon opened 3 years ago

neopsyon commented 3 years ago

Hello,

We're utilizing the BuildHelpers along with https://github.com/psake/PowerShellBuild module. Environment: Azure Pipelines Lately, we're seeing that multiple pipelines are failing due to the error message Invoke-Git : warning: refname 'x' is ambiguous. The error seems to appear randomly, and if the same build is re-run multiple times, sometimes it passes over the error.

maondrej commented 3 years ago

Hello,

just ran it into the same case today.

VERBOSE: Invoking PSdepend... D:\a\1\s\Build\build.ps1 : UNEXPECTED ERROR: warning: refname '224ef3228331ebc4acf2303e6a1f82728227b095' is ambiguous. t C:\Users\Vss dministrator\Documents\WindowsPowerShell\Modules\BuildHelpers\2.0.15\Public\Get-BuildVariable.ps1:189 char:17

neopsyon commented 3 years ago

Hello @maondrej This is how I made the workaround, but definitely, it's some kind of anomaly under the hood. In my build or publish task, for example, I added the following command before the execution of the Module related commands. git config advice.objectNameWarning false

maondrej commented 3 years ago

Hello @nemanja-jovic,

the issue is probably caused by Azure Pipeline agent since version v2.177.1. I can confirm workaround mentioned in thread to set the following variable at the top of CI/CD yaml

variables: 'VSTS.DisableFetchByCommit': 'true'