Skip to content

Commit

Permalink
Fix unsupported repo type (#126)
Browse files Browse the repository at this point in the history
previously:
```
echo 'repositories: {somedir: {type: foo, url: aoeu}}' | vcs import .
Traceback (most recent call last):
  File "/home/dan/.local/bin/vcs", line 11, in <module>
    load_entry_point('vcstool', 'console_scripts', 'vcs')()
  File "/home/dan/Documents/colcon/src/vcstool/vcstool/commands/vcs.py", line 26, in main
    return entrypoint(args)
  File "/home/dan/Documents/colcon/src/vcstool/vcstool/commands/import_.py", line 203, in main
    url = job['command'].url
AttributeError: 'NoneType' object has no attribute 'url'
```

now:
```
echo 'repositories: {somedir: {type: foo, url: aoeu}}' | vcs import .
=== ./somedir (none) ===
Repository type 'foo' is not supported
```
  • Loading branch information
rotu authored Apr 20, 2020
1 parent 083a460 commit 4e0c2f4
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions vcstool/commands/import_.py
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,8 @@ def main(args=None, stdout=None, stderr=None):
ssh_keygen = None
checked_hosts = set()
for job in list(jobs):
if job['command'] is None:
continue
url = job['command'].url
# only check the host from a ssh URL
if not url.startswith('git@') or ':' not in url:
Expand Down

0 comments on commit 4e0c2f4

Please sign in to comment.