module documentation
Generates tarballs for Git trees.
| Class | |
Turn a list of bytestrings into a file-like object. |
| Function | tar |
Generate a tar stream for the contents of a Git tree. |
| Function | _walk |
Recursively walk a dulwich Tree, yielding tuples of (absolute path, TreeEntry) along the way. |
def tar_stream(store:
BaseObjectStore, tree: Tree, mtime: int, prefix: bytes = b'', format: str = '') -> Generator[ bytes, None, None]:
¶
Generate a tar stream for the contents of a Git tree.
Returns a generator that lazily assembles a .tar.gz archive, yielding it in pieces (bytestrings). To obtain the complete .tar.gz binary file, simply concatenate these chunks.
| Parameters | |
store:BaseObjectStore | Object store to retrieve objects from |
tree:Tree | Tree object for the tree root |
mtime:int | UNIX timestamp that is assigned as the modification time for all files, and the gzip header modification time if format='gz' |
prefix:bytes | Optional prefix to prepend to all paths in the archive |
format:str | Optional compression format for tarball |
| Returns | |
Generator[ | Bytestrings |