On Jenkinsfile I'm running few git commands using PowerShell, It seems command are successful but I get strange error. When I run these command directly with powershell I don't have any issues. Here is part of the code:
powershell '''
Write-Output "git checkout -B ar/2020 ============="
git checkout -B ar/2020
Write-Output "git reset --hard HEAD ============="
git reset --hard HEAD
'''
Here is the output:
09:52:29 git checkout -B ar/2020 =============
09:52:37 Your branch is up to date with 'origin/ar/2020'.
09:52:37 powershell.exe : Reset branch 'ar/2020'
09:52:37 At C:\jenkins\workspace\TEST@tmp\durable-90a62004\powershellWrapper.ps1:3 char:1
09:52:37 + & powershell -NoProfile -NonInteractive -ExecutionPolicy Bypass -Comm ...
09:52:37 + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
09:52:37 + CategoryInfo : NotSpecified: (Reset branch 'ar/2020':String) [], RemoteException
09:52:37 + FullyQualifiedErrorId : NativeCommandError
09:52:37
09:52:37 git reset --hard HEAD =============
09:52:55 HEAD is now at af04dfe66cb Update list files