Skip to content

fix: add .agentspace/ to git exclude to allow workspace deletion#16

Merged
ckrough merged 1 commit intomainfrom
relaxed-pike
Dec 21, 2025
Merged

fix: add .agentspace/ to git exclude to allow workspace deletion#16
ckrough merged 1 commit intomainfrom
relaxed-pike

Conversation

@ckrough
Copy link
Owner

@ckrough ckrough commented Dec 21, 2025

Summary

  • Add .agentspace/ to the main repo's .git/info/exclude during workspace creation
  • This prevents the directory from blocking worktree removal as an untracked file
  • Use info/exclude instead of .gitignore because .gitignore would itself be an untracked file

Test plan

  • Added test for exclude file creation during workspace create
  • Added test for idempotency (no duplicate entries)
  • Updated existing tests to remove force=True from workspace removal
  • All 295 tests pass

The .agentspace/ directory was blocking workspace deletion because it
appeared as an untracked file. Now during workspace creation, we add
.agentspace/ to the main repo's .git/info/exclude file, which prevents
git from tracking it without creating another untracked .gitignore file.

Key insight: Git only reads exclude from the main repo's .git/info/exclude,
not from worktree git directories.
@ckrough ckrough merged commit 86be661 into main Dec 21, 2025
5 checks passed
@ckrough ckrough deleted the relaxed-pike branch December 21, 2025 19:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant