How to unpack and delete objects in a dulwich repo?

79 views Asked by At

I am trying to learn how to manipulate the dulwich repository and I can't find how to delete or unpack objects. For example, in the following code:

from dulwich import porcelain
from dulwich.repo import Repo
from dulwich.objects import Blob

myrepo = Repo.init_bare( 'dulwich_repo', mkdir=True)
myblob = Blob.from_string( b'This is my content.' )
myrepo.object_store.add_object(myblob)
porcelain.repack(myrepo)

Now my object folder only contains one pack and no loose objects. How can I "unpack" it? (meaning, recover the loose object in its respective folder and remove the '.pack' and '.idx' files) How can I then delete the now-loose-again object?

0

There are 0 answers