tighten trail worktree checkout guards
main·
Commit

Avoid creating .gitignore when a repo has none, while still appending the managed worktree ignore rule to an existing file.
Verify a registered managed path is still this repo's worktree on the requested branch before reusing it.
Entire-Checkpoint: 01KX6X8CDZ55R4ZPFF1EW2Y774
Checkpoints
Checkpoint 1