

def __init__(self, *args, **kwargs):
    repo = kwargs.pop('repo', None)
    if repo:
        self.__repo = repo
    else:
        try:
            self.__repo = Repo(os.environ.get('GIT_WORK_TREE', os.path.curdir))
        except InvalidGitRepositoryError:
            (exc_class, exc, tb) = sys.exc_info()
            raise GitUpstreamError('Not a git repository', tb)
    self.__git = self.repo.git
    super(GitMixin, self).__init__(*args, **kwargs)

dataset/ETHPy150Open openstack/git-upstream/git_upstream/lib/utils.py GitMixin.__init__/original