From b625aa2fc800eb0f8d4994fedf7a775e164d42e5 Mon Sep 17 00:00:00 2001 From: Pavlo Ratushnyi Date: Fri, 16 Oct 2026 10:14:07 +0200 Subject: [PATCH] regress_3080.sh: read commits from a Windows git worktree under WSL Co-Authored-By: Claude Sonnet 5.5 --- scripts/gpu-bringup/regress_3080.sh | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/scripts/gpu-bringup/regress_3080.sh b/scripts/gpu-bringup/regress_3080.sh index 479353ea..d1ac9f8d 100755 --- a/scripts/gpu-bringup/regress_3080.sh +++ b/scripts/gpu-bringup/regress_3080.sh @@ -52,7 +52,14 @@ command -v cargo >/dev/null || { echo "cargo not found (install rustup via scrip command -v nvidia-smi >/dev/null || { echo "nvidia-smi not found: no GPU visible" >&2; exit 2; } # ------------------------------------------------------------------ source tree -git_() { git -c safe.directory='*' -C "$repo" "$@"; } +# A Windows `git worktree` checkout seen from WSL has a .git file naming a C:/ path: use that git dir (translated) directly. +gitdir_args=(-C "$repo") +if [[ -f "$repo/.git" ]]; then + wt="$(sed -n 's/^gitdir: *//p' "$repo/.git" | head -1)" + if [[ "$wt" =~ ^([A-Za-z]):(.*)$ ]]; then wt="/mnt/${BASH_REMATCH[1],,}${BASH_REMATCH[2]}"; fi + [[ -d "$wt" ]] && gitdir_args=(--git-dir="$wt") +fi +git_() { git -c safe.directory='*' -c core.autocrlf=false -c core.eol=lf "${gitdir_args[@]}" "$@"; } src="$work/src" mkdir -p "$work" if [[ "$commit" == WORKTREE ]]; then