ref:main

feat: git archive (tar/zip/bundle of a tree or commit) #39

open Opened by cole.christensen@gmail.com

Links

No links yet.

Every hosting product has a "Download ZIP / tarball" button. We have no module for it.

Scope

  • ExGitObjectstore.Archive.tar_gz(repo, sha, opts) — stream a gzipped tar of the tree at sha.
  • ExGitObjectstore.Archive.zip(repo, sha, opts) — stream a ZIP of the same.
  • opts: :prefix (directory prefix for entries), :format (tar, tar.gz, zip), :subtree (limit to a subpath).
  • Streaming output — don’t buffer the whole archive.
  • Handle submodule gitlinks (skip or error — decide during impl).
  • Handle symlinks, executable bits (mode encoding).

Acceptance

  • Round-trip: tar xzf on the output gives identical contents to what ObjectResolver yields for each path at that tree.
  • Interop: output byte-compatible with git archive --format=tar.gz at least for trees without exotic modes (we don’t need to hit hash-identical since git’s timestamp field differs).
  • Memory bounded when archiving a 1 GB tree.