-
-
Notifications
You must be signed in to change notification settings - Fork 933
Fetching from remote with explicit refspec raises error incorrectly #396
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Thanks for letting me know - the incorrectly formatted message should now be fixed. However, I am not quite sure why there is no 'fetch' configuration provided here. In a previous commit it is stated that gitpython needs this to work. Just not making the assertion should therefore result in a more difficult to debug error. Maybe you can try removing the assertion in question to see if GitPython will work anyway ? |
I was testing this briefly and found out that the repo has no fetch refspec because I cloned it as a bare repo. Also, I commented the
So, I would be inclined to conclude that the assertion should only be made if no refspec argument is given:
Are there any impediments to this change? |
If there are any impediments, then I don't see them. |
Sure, which branch would you like to fork from? (I'll be assuming it is "master" until I hear back from you) |
GitPython version: 1.0.2
File: git/remote.py
Line: 646
OS: Ubuntu 14.04LTS
Passing a refspec to git fetch through a remote, as in
repo.remotes.origin.fetch("+refs/heads/*:refs/remotes/origin/*")
will raise an error if the remote has no fetch refspec defined in the config:
Also, note that the error message is incorrectly formatted because the remote's name is replaced only in the second line of the message (a %s appears in the first line of the final message).
The
_assert_refspec()
method should not be called if one or more refspecs were given as arguments tofetch()
.The text was updated successfully, but these errors were encountered: