If I create a GitRepository with a spec like this:
spec:
url: https://github.com/squaremo/flux2-example
ref:
commit: 92f0a9e59583732a052178427e376b77ae9e248b
then the source controller fails to clone the repo. Naively, I would expect it to do the equivalent of
git clone --no-checkout https://github.com/squaremo/flux2-example
cd flux2-example; git checkout 92f0a9e59583732a052178427e376b77ae9e248b
Unfortunately, the .branch field has a default of master, and the checkout code checks out the branch first, then the commit (whether or not it's on the branch, so far as I can tell). This seems like a needless step; but it also means you can't specify just a commit, you have to name a branch that exists at the origin, otherwise it'll fail.
If I create a GitRepository with a spec like this:
then the source controller fails to clone the repo. Naively, I would expect it to do the equivalent of
Unfortunately, the
.branchfield has a default ofmaster, and the checkout code checks out the branch first, then the commit (whether or not it's on the branch, so far as I can tell). This seems like a needless step; but it also means you can't specify just a commit, you have to name a branch that exists at the origin, otherwise it'll fail.