Пример #1
0
    def getOrigin(self):
        """
            Returns the URL of the 'origin' (fetch direction).
        """
        tmp = StringIO()

        FastScript.execProgram('git remote -v', stdout=tmp)
        output = tmp.getvalue()
        # Any.requireIsTextNonEmpty( output )  # repo may not have any remote

        tmp = re.search("^origin\s+(.+)\s\(fetch\)", output)

        try:
            origin = tmp.group(1)
        except AttributeError:
            raise ValueError(
                'this Git repository has no "origin" remote peer configured')

        return origin