Skip to content

Fix internal state path for multiple worktrees#331

Closed
wantaekchoi wants to merge 3 commits intoAGWA:masterfrom
wantaekchoi:worktree-common-dir
Closed

Fix internal state path for multiple worktrees#331
wantaekchoi wants to merge 3 commits intoAGWA:masterfrom
wantaekchoi:worktree-common-dir

Conversation

@wantaekchoi
Copy link
Copy Markdown

@wantaekchoi wantaekchoi commented Apr 9, 2026

Summary

This changes git-crypt internal state resolution to use git rev-parse --git-common-dir instead of --git-dir, so linked worktrees share the same key
state.

The regression test coverage and CI wiring are split into separate commits.

Why

With linked worktrees, storing git-crypt state under the worktree-local git dir can make key state invisible to other worktrees in the same repository.
Using the common git dir keeps that state shared as intended.

Validation

  • make test passed in a Rocky Linux 8.10 Docker environment
  • verified that the worktree test checks for key state under git-common-dir/git-crypt/keys/default
  • verified that the worktree-local git-dir/git-crypt/keys/default path is not used

@alerque
Copy link
Copy Markdown
Contributor

alerque commented Apr 9, 2026

Please split the test, CI, and actual fix parts into different commits and properly label them. This PR is doing a lot more than what it says on the tin.

Also please declare what if any LLM is being used here.

@wantaekchoi wantaekchoi force-pushed the worktree-common-dir branch from f91980a to 6392b63 Compare April 9, 2026 09:12
@wantaekchoi wantaekchoi deleted the worktree-common-dir branch April 10, 2026 00:12
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.

2 participants