diff --git a/tests/tools/test_self_repo_guard.py b/tests/tools/test_self_repo_guard.py index 503eac02edc2f..d2738ecc903a9 100644 --- a/tests/tools/test_self_repo_guard.py +++ b/tests/tools/test_self_repo_guard.py @@ -30,6 +30,8 @@ class TestBlocksMutationsInSourceRepo: [ "checkout pr-51020", "switch main", + "bisect start", + "bisect good HEAD~10", "reset --hard origin/main", "reset --har origin/main", "rebase origin/main", diff --git a/tools/self_repo_guard.py b/tools/self_repo_guard.py index 32d3641f29e12..6d3f4b4c815d8 100644 --- a/tools/self_repo_guard.py +++ b/tools/self_repo_guard.py @@ -27,6 +27,9 @@ _WORKTREE_MUTATIONS = frozenset({ "clean", "cherry-pick", "revert", + # bisect drives repeated checkouts of the running root — the exact + # module-version-skew hazard this guard exists for. + "bisect", }) _WORKTREE_TARGET_ACTIONS = frozenset({"move", "remove"}) _STASH_SAFE_ACTIONS = frozenset({"list", "show", "create", "store", "drop", "clear"}) @@ -35,7 +38,6 @@ _KNOWN_GIT_BUILTINS = frozenset({ "add", "am", "apply", - "bisect", "blame", "branch", "bundle",