def get_git_origin(repodir='.'):
    git = subprocess.Popen(['git', 'remote', '-v'], cwd=repodir,
                           stdout=subprocess.PIPE, stderr=subprocess.PIPE)
    stdout, stderr = git.communicate()
    if git.returncode != 0:
        error.raise_error("Command 'git remote' exited with status {0}.",
                          git.returncode)
    for line in stdout.splitlines():
        line = line.strip()
        name, url, direction = line.split()
        if name == 'origin' and direction == '(fetch)':
            return url
Get the URL of the remote tracking branch "origin".
dataset/ETHPy150Open ravello/testmill/lib/testmill/versioncontrol.py/get_git_origin