Skip to content

Commit 5c3d46a

Browse files
ZviBaratzclaude
andcommitted
fix: fail on SHA ref checkout instead of silently testing wrong commit
Shallow clones only fetch HEAD, so `git fetch --depth 1 origin <SHA>` is needed for pinned refs. Previously, both fetch and checkout errors were suppressed (2>/dev/null, || true), causing 4 extensions to silently test at the wrong commit. Now: check exit codes, use FETCH_HEAD for checkout, clean up cache on failure to prevent stale state on --no-fetch reruns. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent ed00ee3 commit 5c3d46a

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

scripts/field-test-runner.sh

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -155,8 +155,16 @@ resolve_ext_path() {
155155
return 1
156156
fi
157157
if [[ -n "$ref" ]]; then
158-
git -C "$RESOLVED_PATH" fetch --depth 1 origin "$ref" 2>/dev/null
159-
git -C "$RESOLVED_PATH" checkout "$ref" 2>/dev/null || true
158+
if ! git -C "$RESOLVED_PATH" fetch --depth 1 origin "$ref" 2>&1; then
159+
echo " SKIP: failed to fetch ref $ref from $repo"
160+
rm -rf "$RESOLVED_PATH"
161+
return 1
162+
fi
163+
if ! git -C "$RESOLVED_PATH" checkout FETCH_HEAD 2>&1; then
164+
echo " SKIP: failed to checkout ref $ref"
165+
rm -rf "$RESOLVED_PATH"
166+
return 1
167+
fi
160168
fi
161169
fi
162170
if [[ ! -d "$RESOLVED_PATH" ]]; then

0 commit comments

Comments
 (0)