Unrelated pushes (the #68/#70 and #69/#71 fix branches from the same session) were failing main's own pre-push hooks for reasons that had nothing to do with their changes:
scripts/install.sh hardcoded $REPO_ROOT/.git/hooks/, which breaks under any git worktree checkout — .git there is a file (a gitlink), not a directory. This blocks every worktree-based agent from installing hooks or pushing cleanly, which is exactly what surfaced this.
plugins/bin/plugin.json, plugins/core/plugin.json, plugins/gitea/plugin.json reference agents/skills directories that don't exist on main yet, failing scripts/check-manifests.sh for any push, regardless of what's being changed. (gitea's real content already exists on the in-flight refactor/6-gitea-deep-modules branch, pending merge — this PR just makes main internally consistent in the meantime; bin and core are unrelated, standalone drift.)
What changed
scripts/install.sh: resolve the git hooks directory via git rev-parse --git-path hooks, unsetting inherited GIT_DIR/GIT_WORK_TREE first (git sets these for hook child processes, which otherwise hijacks -C-based repo discovery) and normalizing to an absolute path (git returns it relative-to-queried-root for plain checkouts, absolute for worktrees).
plugins/bin/plugin.json, plugins/core/plugin.json, plugins/gitea/plugin.json: drop agents/skills fields pointing at directories that don't currently exist.
tests/test-git-hooks-install.sh: added a regression case simulating the inherited-GIT_DIR hook scenario, and isolated the test's own fixture (git init) from ambient GIT_* env vars — the test previously silently re-targeted the real worktree gitdir instead of its temp fixture when run inside a hook, masking the bug it was meant to test.
Verification
Full suite (bash tests/run-tests.sh) and scripts/check-manifests.sh pass, including under the exact GIT_DIR/GIT_EXEC_PATH/etc. environment captured from a real pre-push hook invocation in a worktree.
Not merging this myself — flagging for review since it touches shared install/hook infrastructure.
## Why
Unrelated pushes (the #68/#70 and #69/#71 fix branches from the same session) were failing `main`'s own pre-push hooks for reasons that had nothing to do with their changes:
1. **`scripts/install.sh` hardcoded `$REPO_ROOT/.git/hooks/`**, which breaks under any git worktree checkout — `.git` there is a file (a gitlink), not a directory. This blocks every worktree-based agent from installing hooks or pushing cleanly, which is exactly what surfaced this.
2. **`plugins/bin/plugin.json`, `plugins/core/plugin.json`, `plugins/gitea/plugin.json`** reference `agents`/`skills` directories that don't exist on `main` yet, failing `scripts/check-manifests.sh` for any push, regardless of what's being changed. (`gitea`'s real content already exists on the in-flight `refactor/6-gitea-deep-modules` branch, pending merge — this PR just makes `main` internally consistent in the meantime; `bin` and `core` are unrelated, standalone drift.)
## What changed
- `scripts/install.sh`: resolve the git hooks directory via `git rev-parse --git-path hooks`, unsetting inherited `GIT_DIR`/`GIT_WORK_TREE` first (git sets these for hook child processes, which otherwise hijacks `-C`-based repo discovery) and normalizing to an absolute path (git returns it relative-to-queried-root for plain checkouts, absolute for worktrees).
- `plugins/bin/plugin.json`, `plugins/core/plugin.json`, `plugins/gitea/plugin.json`: drop `agents`/`skills` fields pointing at directories that don't currently exist.
- `tests/test-git-hooks-install.sh`: added a regression case simulating the inherited-`GIT_DIR` hook scenario, and isolated the test's own fixture (`git init`) from ambient `GIT_*` env vars — the test previously silently re-targeted the *real* worktree gitdir instead of its temp fixture when run inside a hook, masking the bug it was meant to test.
## Verification
Full suite (`bash tests/run-tests.sh`) and `scripts/check-manifests.sh` pass, including under the exact `GIT_DIR`/`GIT_EXEC_PATH`/etc. environment captured from a real `pre-push` hook invocation in a worktree.
Not merging this myself — flagging for review since it touches shared install/hook infrastructure.
scripts/install.sh hardcoded $REPO_ROOT/.git/hooks, which breaks under any
git worktree checkout (.git is a file there, not a directory) — this is
what blocks every worktree-based agent from pushing cleanly. Resolve the
hooks directory via `git rev-parse --git-path hooks` instead, normalizing
to an absolute path since git returns it relative to the queried repo root
for plain checkouts but absolute for worktrees.
Also drops `agents`/`skills` fields from plugins/bin, plugins/core, and
plugins/gitea plugin.json where the referenced directories don't exist on
main yet (bin never had an agents/ dir; core and gitea's real skill/agent
content is still pending merge from an in-flight branch) — these were
failing scripts/check-manifests.sh and blocking pushes for unrelated work.
Co-Authored-By: Claude Sonnet 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01FNJWdVvdgvZCHi1hZGqgVQ
The test's own `git -C "$TEMP_REPO" init` silently re-targets an inherited
GIT_DIR instead of creating a repo in the temp dir when this test itself
runs inside a git hook (e.g. pre-push sets GIT_DIR to the invoking repo's
gitdir). Unset all GIT_* vars at the top of the script so the temp repo
fixture is actually isolated regardless of the calling context.
Co-Authored-By: Claude Sonnet 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01FNJWdVvdgvZCHi1hZGqgVQ
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Why
Unrelated pushes (the #68/#70 and #69/#71 fix branches from the same session) were failing
main's own pre-push hooks for reasons that had nothing to do with their changes:scripts/install.shhardcoded$REPO_ROOT/.git/hooks/, which breaks under any git worktree checkout —.gitthere is a file (a gitlink), not a directory. This blocks every worktree-based agent from installing hooks or pushing cleanly, which is exactly what surfaced this.plugins/bin/plugin.json,plugins/core/plugin.json,plugins/gitea/plugin.jsonreferenceagents/skillsdirectories that don't exist onmainyet, failingscripts/check-manifests.shfor any push, regardless of what's being changed. (gitea's real content already exists on the in-flightrefactor/6-gitea-deep-modulesbranch, pending merge — this PR just makesmaininternally consistent in the meantime;binandcoreare unrelated, standalone drift.)What changed
scripts/install.sh: resolve the git hooks directory viagit rev-parse --git-path hooks, unsetting inheritedGIT_DIR/GIT_WORK_TREEfirst (git sets these for hook child processes, which otherwise hijacks-C-based repo discovery) and normalizing to an absolute path (git returns it relative-to-queried-root for plain checkouts, absolute for worktrees).plugins/bin/plugin.json,plugins/core/plugin.json,plugins/gitea/plugin.json: dropagents/skillsfields pointing at directories that don't currently exist.tests/test-git-hooks-install.sh: added a regression case simulating the inherited-GIT_DIRhook scenario, and isolated the test's own fixture (git init) from ambientGIT_*env vars — the test previously silently re-targeted the real worktree gitdir instead of its temp fixture when run inside a hook, masking the bug it was meant to test.Verification
Full suite (
bash tests/run-tests.sh) andscripts/check-manifests.shpass, including under the exactGIT_DIR/GIT_EXEC_PATH/etc. environment captured from a realpre-pushhook invocation in a worktree.Not merging this myself — flagging for review since it touches shared install/hook infrastructure.