Skip to content

Commit 11af073

Browse files
Set the probe branch upstream with push -u, and log why when it fails
Setting the upstream separately depended on the push having created refs/remotes/origin/probe-main, which it did not on the CI runners. The case then failed on its own positive control with nothing in the log explaining it, so the fix was guesswork twice. push -u does both, and the control now carries the push output when it fires. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
1 parent 0af8a0d commit 11af073

1 file changed

Lines changed: 5 additions & 3 deletions

File tree

‎tests/install-matrix.sh‎

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -732,16 +732,18 @@ if want doctor-no-mutate; then
732732
# the destructive pairing, set locally so the case does not depend on the operator's config
733733
git -C "$T/work" config fetch.prune true
734734
git -C "$T/work" config fetch.pruneTags true
735-
git -C "$T/work" push -q origin probe-main:refs/heads/probe-main 2>/dev/null
736-
git -C "$T/work" branch -q --set-upstream-to=origin/probe-main 2>/dev/null
735+
# push -u in one step. Setting the upstream separately depended on the push having created
736+
# refs/remotes/origin/probe-main, which it did not do on the CI runners, and the case then
737+
# failed on its own control with no way to see why from the log.
738+
git -C "$T/work" push -u origin probe-main > "$T/push.log" 2>&1 || true
737739
git -C "$T/work" tag -a v9.9.9-local -m "never pushed" 2>/dev/null
738740
e=""
739741
# Two positive controls. Without them the case passes on any machine where the tag was never
740742
# created or where --drift declined to run, which is the shape of every fake green here.
741743
git -C "$T/work" rev-parse -q --verify refs/tags/v9.9.9-local >/dev/null 2>&1 \
742744
|| e="$e; the probe tag was never created, so this case proves nothing"
743745
git -C "$T/work" rev-parse --symbolic-full-name '@{u}' >/dev/null 2>&1 \
744-
|| e="$e; no upstream, so the code path under test never runs"
746+
|| e="$e; no upstream, so the code path under test never runs [$(tr '\n' ' ' < "$T/push.log" 2>/dev/null | cut -c1-160)]"
745747
HOME="$T" VSTACK_DIR="$T/work" "$SRC/bin/doctor" --drift > "$T/out" 2>&1
746748
grep -q 'no vstack repo found' "$T/out" 2>/dev/null \
747749
&& e="$e; --drift refused to run, so it never reached the fetch this case is about"

0 commit comments

Comments
 (0)