def clone(cls, remote_url, path):
"""Clone the remote and return a GitVcs object pointed at the new repo.
:param str remote_url: the URL to clone from
:param str path: path to clone to
:rtype: GitVcs
:returns: a GitVcs object for the new cloned repo
:raises tigerhost.vcs.base.CommandError:
"""
args = ['git', 'clone', '--recursive', remote_url, path]
proc = Popen(args, stdout=PIPE, stderr=PIPE)
(stdout, stderr) = proc.communicate()
if proc.returncode != 0:
raise CommandError(args[0], proc.returncode, stdout, stderr)
return cls(path=path)
评论列表
文章目录