diff --git a/scripts/check-phase35.sh b/scripts/check-phase35.sh index 288c8867..e22aafc9 100755 --- a/scripts/check-phase35.sh +++ b/scripts/check-phase35.sh @@ -609,6 +609,8 @@ self_test_consumers() { echo "refuse: self-test workspace_check refused a consumer that resolves the framework to the expected checkout" >&2 return 1 fi + # A copy of the planted consumer's go.mod, compared after the modfile run. + cp "$consumer/go.mod" "$tmp/consumer-go.mod.before" rc=0 out="$(ROOT="$fw" GOWORK=off GOPROXY=off GOFLAGS= GOTOOLCHAIN=local workspace_check "$consumer" "-mod=mod -modfile=$mod/go.mod" 2>&1)" || rc=$? if [[ "$rc" -eq 0 ]] || ! grep -q "^refuse: $consumer resolves git.golem15.com/golem15/summercms to .*elsewhere" <<<"$out"; then @@ -616,7 +618,7 @@ self_test_consumers() { echo "refuse: self-test workspace_check under a scratch modfile accepted a framework that resolves elsewhere (exit $rc)" >&2 return 1 fi - if [[ -n "$(git -c safe.directory='*' -C "$repo" status --porcelain -- go.mod)" ]] || ! grep -q '=> ../framework' "$consumer/go.mod"; then + if ! cmp -s "$tmp/consumer-go.mod.before" "$consumer/go.mod" || ! grep -q '=> ../framework' "$consumer/go.mod"; then echo "refuse: self-test the modfile run wrote the planted consumer's go.mod" >&2 return 1 fi