'Determine the repository that a given path is from.
Args:
path [string]: The path to the repository
which [string]: The remote repository name (origin or upstream).
Returns:
The origin url for path, or None if not a git repository.'

def get_remote_repository_url(self, path, which='origin'):

    result = run_quick('git    -C    {path}    config    --get    remote.{which}.url'.format(path=path, which=which), echo=False)
    if result.returncode:
        return None
    return result.stdout.strip()
