Skip to content

Commit

Permalink
Merge branch 'fix_git_detectoin' of https://github.com/adrianschroete…
Browse files Browse the repository at this point in the history
…r/osc

Fix heuristic to detect a git url. It does not have to necessarily end
with ".git" and can start with git:// or git@.
  • Loading branch information
marcus-h committed May 5, 2020
2 parents 9aa3777 + 5d6351b commit 1d056c0
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions osc/commandline.py
Original file line number Diff line number Diff line change
Expand Up @@ -4668,11 +4668,10 @@ def do_add(self, subcmd, opts, *args):

# Do some magic here, when adding a url. We want that the server to download the tar ball and to verify it
for arg in parseargs(args):
if arg.startswith('http://') or arg.startswith('https://') or arg.startswith('ftp://') or arg.startswith('git://'):
if arg.endswith('.git'):
addGitSource(arg)
else:
addDownloadUrlService(arg)
if arg.endswith('.git') or arg.startswith('git://') or arg.startswith('git@'):
addGitSource(arg)
elif arg.startswith('http://') or arg.startswith('https://') or arg.startswith('ftp://'):
addDownloadUrlService(arg)
else:
addFiles([arg])

Expand Down

0 comments on commit 1d056c0

Please sign in to comment.