Skip to content

Commit 3cdb7cc

Browse files
Build the drift probe repo instead of cloning it
CI checks out shallow for the install jobs, a clone of a shallow repo is shallow, and pushing one to a bare remote is rejected outright with "shallow update not allowed". The case then failed on its own positive control, correctly, three times running. --drift only needs the directory to look like a vstack checkout, so the probe is now a copy of the tree with a one-commit history of its own. Nothing it reads needs more than that. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
1 parent 11af073 commit 3cdb7cc

1 file changed

Lines changed: 14 additions & 7 deletions

File tree

tests/install-matrix.sh

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -721,14 +721,21 @@ if want doctor-no-mutate; then
721721
# A real vstack checkout, because --drift refuses to run against anything else and a scratch
722722
# repo made it bail before ever reaching the fetch -- which is how the first version of this
723723
# case passed against the unfixed doctor.
724-
git clone -q "$SRC" "$T/work" 2>/dev/null
725-
# CI checks out a PR merge ref, so the clone lands on a detached HEAD and
726-
# --set-upstream-to has no branch to attach to. Name one explicitly rather than inheriting
727-
# whatever the source checkout happened to be sitting on.
728-
git -C "$T/work" checkout -q -B probe-main 2>/dev/null
729-
git init -q --bare "$T/remote.git"
730-
git -C "$T/work" remote set-url origin "$T/remote.git"
724+
# A copy of the tree with a fresh history, not a clone. --drift only requires that the
725+
# directory look like a vstack checkout, and cloning inherited the source repo's shape: CI
726+
# checks out shallow, a clone of a shallow repo is shallow, and pushing one to a bare remote
727+
# is rejected outright with "shallow update not allowed". One commit is enough for
728+
# everything --drift reads.
729+
mkdir -p "$T/work"
730+
cp -R "$SRC"/. "$T/work"/ 2>/dev/null
731+
rm -rf "$T/work/.git"
732+
git -C "$T/work" init -q
731733
git -C "$T/work" config user.email t@example.com; git -C "$T/work" config user.name t
734+
git -C "$T/work" add -A >/dev/null 2>&1
735+
git -C "$T/work" commit -qm probe >/dev/null 2>&1
736+
git -C "$T/work" checkout -q -B probe-main
737+
git init -q --bare "$T/remote.git"
738+
git -C "$T/work" remote add origin "$T/remote.git"
732739
# the destructive pairing, set locally so the case does not depend on the operator's config
733740
git -C "$T/work" config fetch.prune true
734741
git -C "$T/work" config fetch.pruneTags true

0 commit comments

Comments
 (0)