Skip to content

Don't crash if the matched pathspec is NULL#1267

Merged
weihanglo merged 2 commits into
rust-lang:mainfrom
ehuss:empty-pathspec-add-all-panic
May 29, 2026
Merged

Don't crash if the matched pathspec is NULL#1267
weihanglo merged 2 commits into
rust-lang:mainfrom
ehuss:empty-pathspec-add-all-panic

Conversation

@ehuss
Copy link
Copy Markdown
Contributor

@ehuss ehuss commented May 29, 2026

In the index add_all callback, if the matched pathspec is NULL, this was crashing due to the panic in the C callback.

The temporary solution here is to handle the panic inside the panic wrapper. A future version will change the signature of the callback to handle this situation.

cc #585

ehuss added 2 commits May 29, 2026 08:26
This particular situation with a callback is crashing.
In the index add_all callback, if the matched pathspec is NULL, this was
crashing due to the panic in the C callback.

The temporary solution here is to handle the panic inside the panic
wrapper. A future version will change the signature of the callback to
handle this situation.
@rustbot rustbot added the S-waiting-on-review Status: Waiting on review label May 29, 2026
@ehuss
Copy link
Copy Markdown
Contributor Author

ehuss commented May 29, 2026

cc #1268 which has the real fix.

@weihanglo weihanglo added this pull request to the merge queue May 29, 2026
Merged via the queue into rust-lang:main with commit d689d20 May 29, 2026
7 checks passed
@rustbot rustbot removed the S-waiting-on-review Status: Waiting on review label May 29, 2026
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.

3 participants