Example #1
0
 def list_branch(self, repo_name):
     """
     Lists the active branch objects on a repo. Returns a list of
     `BranchInfo` objects.
     Params:
     * repo_name: A string specifying the repo name.
     """
     req = proto.ListBranchRequest(repo=proto.Repo(name=repo_name))
     res = self.stub.ListBranch(req, metadata=self.metadata)
     return res.branch_info
Example #2
0
    def list_branch(self, repo_name):
        """
        Lists the active Branch objects on a Repo.

        Params:
        * repo_name: The name of the repo.
        """
        req = proto.ListBranchRequest(repo=proto.Repo(name=repo_name))
        res = self.stub.ListBranch(req, metadata=self.metadata)
        if hasattr(res, 'branch_info'):
            return res.branch_info
        return []