I have a private Git repo hosted in BitBucket Cloud, and I am using Azure DevOps to run a YAML pipeline against it. The repo was originally hosted in Azure DevOps, but was recently migrated over to BitBucket and the pipeline updated.
When I use the default options to run the pipeline (so Git uses the latest commit from the specified branch) everything works fine; but if I enter a specific commit SHA in the Commit input box, then when DevOps tries to check out the repository then it fails as follows:
git --config-env=http.extraheader=env_var_http.extraheader fetch --force --no-tags --prune --prune-tags --progress --no-recurse-submodules origin +17fce92
fatal: couldn't find remote ref 17fce92
##[warning]Git fetch failed with exit code 128, back off 5.56 seconds before retry.
git --config-env=http.extraheader=env_var_http.extraheader fetch --force --no-tags --prune --prune-tags --progress --no-recurse-submodules origin +17fce92
fatal: couldn't find remote ref 17fce92
##[warning]Git fetch failed with exit code 128, back off 5.088 seconds before retry.
git --config-env=http.extraheader=env_var_http.extraheader fetch --force --no-tags --prune --prune-tags --progress --no-recurse-submodules origin +17fce92
fatal: couldn't find remote ref 17fce92
##[error]Git fetch failed with exit code: 128
Given that it will build happily when I don't specify the commit, does anyone have any idea what I'm doing wrong?
You need to specify the full commit ID instead of the short one.
I can reproduce the issue with short hash, but it works for long hash.