1
0
mirror of https://gitlab.com/fdroid/fdroidserver.git synced 2024-11-20 13:50:12 +01:00

git-svn: use '--' to isolate user input in command lines

This commit is contained in:
Hans-Christoph Steiner 2018-02-05 13:22:06 +01:00
parent 1626655879
commit c67ed5e85f

View File

@ -975,6 +975,7 @@ class vcs_gitsvn(vcs):
if not os.path.exists(self.local): if not os.path.exists(self.local):
# Brand new checkout # Brand new checkout
gitsvn_args = ['svn', 'clone'] gitsvn_args = ['svn', 'clone']
remote = None
if ';' in self.remote: if ';' in self.remote:
remote_split = self.remote.split(';') remote_split = self.remote.split(';')
for i in remote_split[1:]: for i in remote_split[1:]:
@ -984,17 +985,15 @@ class vcs_gitsvn(vcs):
gitsvn_args.extend(['-t', i[5:]]) gitsvn_args.extend(['-t', i[5:]])
elif i.startswith('branches='): elif i.startswith('branches='):
gitsvn_args.extend(['-b', i[9:]]) gitsvn_args.extend(['-b', i[9:]])
gitsvn_args.extend([remote_split[0], self.local]) remote = remote_split[0]
p = self.git(gitsvn_args, output=False)
if p.returncode != 0:
self.clone_failed = True
raise VCSException("Git svn clone failed", p.output)
else: else:
gitsvn_args.extend([self.remote, self.local]) remote = self.remote
p = self.git(gitsvn_args, output=False)
if p.returncode != 0: gitsvn_args.extend(['--', remote, self.local])
self.clone_failed = True p = self.git(gitsvn_args)
raise VCSException("Git svn clone failed", p.output) if p.returncode != 0:
self.clone_failed = True
raise VCSException(_('git svn clone failed'), p.output)
self.checkrepo() self.checkrepo()
else: else:
self.checkrepo() self.checkrepo()