fix(hub): never lazy-fetch a missing object in the worktree scan

Agents write the repos the tree view scans. A repo with remote.<name>.promisor=true and a ref to a missing object made for-each-ref fetch it, and that fetch ran the repo's remote.<name>.uploadpack through sh inside the hub container. The scan's git env now sets GIT_NO_LAZY_FETCH=1 (the image ships git 2.47, which honours it); the new test proves no uploadpack runs.

🎯 Fix: 95 %
💥 Break: 1 %
💸 Cost: –
⏱️ Time: –
🛡️ Security: 100 %
🏆 Score: 94
🚦 Gate: ✅ 90/5, cost and time <= 100, security 100 %

```
/home/kevinveenbirkenbach/Repositories/github.com/kevinveenbirkenbach/skills/.worktrees/feature/kvb-hub
```

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Kevin Veen-BirkenbachandClaude Opus 5.5 committed 2026-11-06 18:46:40 +00:00
1 parent afd96fcd72
commit c69a496c86
2 files changed
+20 -1

No files matched your search

+1 -1
View File
@@ -18,7 +18,7 @@ GIT_TIMEOUT = 10
def git(cwd: Path, args: list[str], home: Path) -> str | None:
env = {"PATH": SAFE_PATH, "HOME": str(home), "GIT_CONFIG_NOSYSTEM": "1", "GIT_OPTIONAL_LOCKS": "0", "GIT_TERMINAL_PROMPT": "0", "LC_ALL": "C"}
env = {"PATH": SAFE_PATH, "HOME": str(home), "GIT_CONFIG_NOSYSTEM": "1", "GIT_NO_LAZY_FETCH": "1", "GIT_OPTIONAL_LOCKS": "0", "GIT_TERMINAL_PROMPT": "0", "LC_ALL": "C"}
try:
done = subprocess.run(
["git", "-c", "safe.directory=*", "-c", "core.fsmonitor=false", "-C", str(cwd), *args],