regress_3080.sh: read commits from a Windows git worktree under WSL
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Sonnet 5.5
parent
6173c2d309
commit
b625aa2fc8
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user