Skip to content

fix: exclude .claude-pr snapshot from git staging#1277

Open
cvan20191 wants to merge 1 commit intoanthropics:mainfrom
cvan20191:codex/exclude-claude-pr-snapshot
Open

fix: exclude .claude-pr snapshot from git staging#1277
cvan20191 wants to merge 1 commit intoanthropics:mainfrom
cvan20191:codex/exclude-claude-pr-snapshot

Conversation

@cvan20191
Copy link
Copy Markdown

@cvan20191 cvan20191 commented Apr 30, 2026

Summary

Fixes the .claude-pr/ snapshot being staged by broad Git commands such as git add -A.

Details

  • Adds ensureClaudePrExcludedFromGit() in src/github/operations/restore-config.ts.
  • Writes /.claude-pr/ to .git/info/exclude after restoreConfigFromBase() creates the snapshot.
  • Leaves the working-tree .gitignore unchanged.
  • Adds test/restore-config.test.ts coverage for repeated restores, existing .gitignore contents, git add -A, and committed files.

Related Issues

Fixes #1275.

Validation

  1. TMPDIR=/tmp bun test test/restore-config.test.ts
  2. TMPDIR=/tmp bun test
  3. TMPDIR=/tmp bun run typecheck
  4. TMPDIR=/tmp bun run format:check

@cvan20191 cvan20191 marked this pull request as ready for review April 30, 2026 00:36
@cvan20191 cvan20191 force-pushed the codex/exclude-claude-pr-snapshot branch from 8c9fbb2 to acf23d1 Compare April 30, 2026 00:48
@cvan20191
Copy link
Copy Markdown
Author

@ashwin-ant @OctavianGuzu would you mind reviewing this when you have a moment?

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.

restoreConfigFromBase snapshot at .claude-pr/ gets committed to PR branch when bot pushes a fix

1 participant