Azure DevOps: fails to checkout and determine revision for GitRepository.spec.ref.name
#1166
Labels
wontfix
This will not be worked on
Flux v.0.42
This error relates to the use case described in issue 963. Our git repository is hosted on Azure Devops.
When using the
GitRepository.spec.ref.name: refs/pull/430/merge
we get an error as below:This error only happens, when the commit that the git reference points to, does not exist in any branch under refs/heads or /refs/tags.
It works when I push the cae9c52ebae189cf07cec3635137a2e4f1ad56da commit into a "normal" branch under /refs/heads/.
The implementation of spec.ref.name, does not take into account, that the default git refspec is
+refs/heads/*:refs/remotes/origin/*
, hencegit clone
will not download the git references outsiderefs/heads
orrefs/tags
, sogit checkout
will fail.A simple solution would be to add a
git fetch origin <git-reference>
before trying to do agit checkout
in the code. Unfortunately, it seems that go-git does not fully implement the v2 wire protocol, so git fetch might corrupt the repository.The text was updated successfully, but these errors were encountered: