'Iterate parent directories to discover a repository
Return a Repo object for the first parent directory that looks like a
Git repository.
:param start: The directory to start discovery from (defaults to \'.\')'

@classmethod
def discover(cls, start='.'):

    remaining = True
    path = os.path.abspath(start)
    while remaining:
        try:
            return cls(path)
        except NotGitRepository:
            (path, remaining) = os.path.split(path)
    raise NotGitRepository(('No    git    repository    was    found    at    %(path)s' % dict(path=start)))
