Closed
Description
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:
AssertionError: Remote '%s' has no refspec set.
You can set it as follows: 'git config --add "remote.origin.fetch +refs/heads/*:refs/heads/*"'.
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 to fetch()
.