diff --git a/vcsserver/remote/git_remote.py b/vcsserver/remote/git_remote.py --- a/vcsserver/remote/git_remote.py +++ b/vcsserver/remote/git_remote.py @@ -551,6 +551,13 @@ class GitRemote(RemoteBase): return _branch(context_uid, repo_id, commit_id) @reraise_safe_exceptions + def delete_branch(self, wire, branch_name): + repo_init = self._factory.repo_libgit2(wire) + with repo_init as repo: + if branch := repo.lookup_branch(branch_name): + branch.delete() + + @reraise_safe_exceptions def commit_branches(self, wire, commit_id): cache_on, context_uid, repo_id = self._cache_on(wire) region = self._region(wire)