Clarify USE_SHELL warning helper signature
#2045
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This is a minor refactor of how
_warn_use_shellcan be, and is, invoked.The
_warn_use_shellhelper function ingit.cmdtakes a singlebool-valued argumentextra_danger, which is conceptually associated with having aTruevalue ofUSE_SHELL, but the association is not necessarily obvious. Specifically:USE_SHELLon theGitclass or through an instance,extra_dangeris alwaysFalse. This is so even if theUSE_SHELLvalue is currentlyTrue, because the danger that arises fromTrueoccurs internally.USE_SHELL, which can only be done on theGitclass and not on or through an instance,extra_dangeris the value set for the attribute. This is because settingUSE_SHELLtoTrueincurs the danger described in #1896.When reading the code, which passed
extra_dangerpositionally, the meaning of the parameter may not always have been obvious.This makes the
extra_dangerparameter keyword-only, and passes it by keyword in all invocations, so that its meaning is clearer.