fix(tools): classify git bisect as a worktree mutation

bisect sat in _KNOWN_GIT_BUILTINS and was allowed in the running source
root, yet it repeatedly checks out commits — the exact module-version
skew this guard exists to prevent. Move it to _WORKTREE_MUTATIONS.
This commit is contained in:
kshitij 2026-08-08 14:35:54 +05:30
parent cd869f26f3
commit daa139c9e3
2 changed files with 5 additions and 1 deletions

View File

@ -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",

View File

@ -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",