Skip to content

Commit 3e06362

Browse files
committed
fix(ci): isolated VM checkout inherits the base's real origin URL
`git clone --local` points origin at the base PATH, so a later `git fetch origin <branch>` inside the isolated tree would resolve against whatever the shared base happens to hold - i.e. another session's state, the exact coupling the per-run checkout exists to remove. Inherit the base's origin URL at clone time so the isolated tree fetches from GitHub itself. Signed-off-by: Martin Vogel <martin.vogel.tech@gmail.com>
1 parent cad2b02 commit 3e06362

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

‎test-infrastructure/vm/win.sh‎

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,12 @@ vm() { local env="$1"; shift
141141
# fresh network clone. No-op when running in the shared (default) tree.
142142
vm_ensure_run_checkout() {
143143
[ "$VM_REPO" = "$VM_BASE_REPO" ] && return 0
144-
vm clangarm64 "[ -d '$VM_REPO/.git' ] || git clone --local '$VM_BASE_REPO' '$VM_REPO'"
144+
# `git clone --local` points origin at the base PATH, so a later
145+
# `fetch origin <branch>` would resolve against whatever the base happens
146+
# to hold (i.e. another session's state) instead of GitHub. Inherit the
147+
# base's real origin URL so the isolated tree fetches independently.
148+
vm clangarm64 "[ -d '$VM_REPO/.git' ] || { git clone --local '$VM_BASE_REPO' '$VM_REPO' && \
149+
git -C '$VM_REPO' remote set-url origin \"\$(git -C '$VM_BASE_REPO' remote get-url origin)\"; }"
145150
}
146151

147152
# The VM tree must be the one the caller means. A concurrent session running

0 commit comments

Comments
 (0)