mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
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:
parent
1085eeab2b
commit
c012dcc2f6
1 changed files with 1 additions and 3 deletions
|
@ -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 = []
|
||||
|
|
Loading…
Add table
Reference in a new issue