From 1e29e4a970e46886decf99b8423fec2915208b27 Mon Sep 17 00:00:00 2001 From: SaiPisey2 Date: Tue, 1 Sep 2026 18:57:10 +0530 Subject: [PATCH] docs: correct the shallow clone claim for commit plus branch Combining .spec.ref.commit with .spec.ref.branch does not shallow clone. cloneCommit in fluxcd/pkg/git/gogit sets no Depth at all, unlike the branch, tag and semver paths, so a branch only narrows the clone to a single branch and the full history of that branch is still fetched. The wording predates the go-git and libgit2 split and has been inaccurate since. Signed-off-by: SaiPisey2 (cherry picked from commit 2b0f0b1ebaf6d6b06309e0c7dfcb8bc31b13f7d0) --- docs/spec/v1/gitrepositories.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/docs/spec/v1/gitrepositories.md b/docs/spec/v1/gitrepositories.md index 97fecc4e7..4c9d244af 100644 --- a/docs/spec/v1/gitrepositories.md +++ b/docs/spec/v1/gitrepositories.md @@ -607,8 +607,9 @@ spec: ``` This field takes precedence over all other fields. It can be combined with -`.spec.ref.branch` to perform a shallow clone of the branch, in which the -commit must exist: +`.spec.ref.branch` to restrict the clone to a single branch, in which the +commit must exist. Note that this is not a shallow clone: the commit is +fetched with the full history of that branch. ```yaml ---