-
Notifications
You must be signed in to change notification settings - Fork 2
Worktree snapshots lack object database — git shows "No commits yet" #49
Copy link
Copy link
Description
Problem
When running an agent in a git worktree workspace, git status inside the VM works without errors but shows "No commits yet" with all files untracked. This is because worktree object databases live in the main repo's .git/objects/, which is outside the workspace and not mounted in the VM.
Current state
As of #48, worktree snapshots have:
- Sanitized
.git/config(readable, credentials stripped) HEAD(symbolic ref from the worktree's gitdir)- Empty
objects/andrefs/directories
This is enough for git status to run without errors, but git can't resolve any refs.
Options considered
- Mount main repo's
.git/objects/read-only into the VM — gives full history, objects are immutable so read-only mount is safe. Requires wiring the resolved commondir path through sanitizer → VM runner. - Copy pack files — works but expensive for large repos.
- Synthetic initial commit —
git init && git add . && git commitprogrammatically. Agent can track its own changes but loses original history. objects/info/alternates— requires a valid in-VM path to the main repo's objects, so depends on option 1.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels