Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

fetch command error on parsing parameters - 3.1.30+ #1568

Closed Answered by Byron
pomareta asked this question in Q&A
Discussion options

Doing
image
repo.remotes.origin.fetch(['--prune', '--prune-tags'])

works well until 3.1.29 version, but when updating to 3.1.30 or 3.1.31 fetch command stops working because it tries to take the parameter --prune as a remote

cmdline: git fetch -v -- origin --prune --prune-tags
stderr: 'fatal: couldn't find remote ref --prune'

image

Thanks for reviewing this

You must be logged in to vote

This is a feature to prevent command injection when passing options. I think there are workarounds too, but don't know what exactly it is.

You could try .fetch(prune=True, prune_tags=True) which should be except from injection projection, or try to set .fetch(..., allow_unsafe_options=True)`.

Hope that helps.

Replies: 2 comments

Comment options

This is a feature to prevent command injection when passing options. I think there are workarounds too, but don't know what exactly it is.

You could try .fetch(prune=True, prune_tags=True) which should be except from injection projection, or try to set .fetch(..., allow_unsafe_options=True)`.

Hope that helps.

You must be logged in to vote
0 replies
Answer selected by pomareta
Comment options

Hello,

Sorry for the late answer. That worked fine. Thanks a lot !
image

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #1567 on March 30, 2023 14:47.

AltStyle によって変換されたページ (->オリジナル) /