Convenience function that calls :meth:`GitRef.delete` :rtype: bool.
(self, force: bool = False)
| 862 | return self.head.repo.create_git_ref(f"refs/heads/{self.head.ref}", sha=self.head.sha) |
| 863 | |
| 864 | def delete_branch(self, force: bool = False) -> None: |
| 865 | """ |
| 866 | Convenience function that calls :meth:`GitRef.delete` :rtype: bool. |
| 867 | """ |
| 868 | if not force: |
| 869 | remaining_pulls = self.head.repo.get_pulls(head=f"{self.head.repo.owner.login}:{self.head.ref}") |
| 870 | if remaining_pulls.totalCount > 0: |
| 871 | raise RuntimeError( |
| 872 | "This branch is referenced by open pull requests, set force=True to delete this branch." |
| 873 | ) |
| 874 | return self.head.repo.get_git_ref(f"heads/{self.head.ref}").delete() |
| 875 | |
| 876 | def enable_automerge( |
| 877 | self, |
no test coverage detected