Check if the remote exists before casting to a string.

The bug before was if the origin wasn't specified None would be cast to a string-- which would then be interpreted as True-- which would end up trying to run `git fetch None` which doesn't work :)
This commit is contained in:
Thomas Jackson 2015-10-19 18:22:08 -07:00
parent 1085eeab2b
commit c012dcc2f6

View file

@ -1375,10 +1375,8 @@ def fetch(cwd,
command.extend(
[x for x in _format_opts(opts) if x not in ('-f', '--force')]
)
if not isinstance(remote, six.string_types):
remote = str(remote)
if remote:
command.append(remote)
command.append(str(remote))
if refspecs is not None:
if isinstance(refspecs, (list, tuple)):
refspec_list = []