Skip to content

Skip staging in delete_file when the path is untracked#2561

Merged
hiroshinishio merged 1 commit intomainfrom
wes
Apr 20, 2026
Merged

Skip staging in delete_file when the path is untracked#2561
hiroshinishio merged 1 commit intomainfrom
wes

Conversation

@hiroshinishio
Copy link
Copy Markdown
Collaborator

No description provided.

Sentry AGENT-36X/36W/344 fired when the agent called delete_file on a
gitignored path (mongodb-memory-server extracts tarballs into the
gitignored mongodb-binaries/). delete_file did os.remove then invoked
git_commit_and_push, which tried to stage the path; git matched nothing
(path never in the index, now gone from disk) and raised
"pathspec did not match any files".

Check tracking with `git ls-files --error-unmatch <path>` before the
os.remove. When untracked, skip the commit entirely and return the
success message from the local deletion.
@hiroshinishio hiroshinishio self-assigned this Apr 20, 2026
@hiroshinishio hiroshinishio merged commit a40ef93 into main Apr 20, 2026
1 check passed
@hiroshinishio hiroshinishio deleted the wes branch April 20, 2026 03:44
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