← Back to team overview

dulwich-users team mailing list archive

Re: Deleting a remote branch via Dulwich?

 

On Tue, Jul 03, 2012 at 11:04:30PM -0700, Andi McClure wrote:
> Hello, I am trying to patch the "hg-git" project, which is based on
> Dulwich. I do not understand very much about what I am doing and am mostly
> working by studying the surrounding code. What I am trying to do is add a
> feature where I delete a remote branch by name.

> As far as I can tell, the way I'm meant to communicate with the server is
> to call
> client.send_pack(path, changed, genpack)
> where client is a GitClient object, path is the appropriate git path,
> "changed" is a method taking a dictionary of branch-name
> ->branch-points-to-rev and returning a new dictionary describing same, and
> "genpack" is dulwich.object_store.BaseObjectStore.generate_pack_contents.
> The existing hg-git code uses this interface to upload objects and assign
> refs.

> How can I use the GitClient object to *delete* a ref, though?
You should be able to do this by setting a particular ref to the
ZERO_SHA1.

Note that the server has to support the 'delete-refs' capability for
this to work.

Cheers,

Jelmer


Follow ups

References