fix: check-no-upstream-edits.sh aborts when upstream/master ref missing
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -106,3 +106,16 @@ make_test_repo() {
|
||||
run "$SCRIPT"
|
||||
[ "$status" -eq 0 ]
|
||||
}
|
||||
|
||||
@test "exits 1 when upstream/master ref is missing" {
|
||||
TMP_REPO=$(make_test_repo)
|
||||
cd "$TMP_REPO"
|
||||
# Delete the upstream/master ref we set in make_test_repo.
|
||||
git update-ref -d refs/remotes/upstream/master
|
||||
# Modify an upstream file in working tree — would normally trigger violation.
|
||||
echo "edit" >> glabels-source.cpp
|
||||
|
||||
run "$SCRIPT"
|
||||
[ "$status" -eq 1 ]
|
||||
[[ "$output" == *"upstream/master ref not found"* || "$stderr" == *"upstream/master ref not found"* ]]
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user