def delete_branch(self, repo_name, branch_name):
        """
        Deletes a branch, but leaves the commits themselves intact. In other
        words, those commits can still be accessed via commit IDs and other
        branches they happen to be on.

        Params:
        * repo_name: The name of the repo.
        * branch_name: The name of the branch to delete.
        """
        res = proto.DeleteBranchRequest(repo=Repo(name=repo_name), branch=branch_name)
        self.stub.DeleteBranch(res, metadata=self.metadata)
Exemple #2
0
 def delete_branch(self, repo_name, branch_name, force=None):
     """
     Deletes a branch, but leaves the commits themselves intact. In other
     words, those commits can still be accessed via commit IDs and other
     branches they happen to be on.
     Params:
     * repo_name: A string specifying the repo name.
     * branch_name: A string specifying the name of the branch to delete.
     * force: A bool specifying whether to force the branch deletion.
     """
     branch = proto.Branch(repo=proto.Repo(name=repo_name),
                           name=branch_name)
     req = proto.DeleteBranchRequest(branch=branch, force=force)
     self.stub.DeleteBranch(req, metadata=self.metadata)