Git

Git's on-disk formats in Ziran, with no allocation and no file I/O: callers read and write .git themselves and hand this package byte slices.

  • git: object ids (SHA-1), kind size\0 headers, loose objects (written as stored zlib blocks, read with compression's inflate, Adler-32 checked), trees in Git's sort order, commits, refs and packed-refs.
  • git_pack: packfile index (version 2) lookup, pack entry headers, entry inflation and delta application, for reading real clones.
  • git_url: remote location validation with the rules of Rust's gix-url 0.40 (URLs, SCP-style user@host:path, remote helpers, IPv6 literals, percent escapes), and GitSanitizeUrl, which removes user names and passwords for display while keeping SSH's conventional git user.

SHA-256 repositories are not supported yet.

make check ZIRAN=path/to/ziran builds and runs the tests as C. The package targets native builds (C, Go): it indexes caller-owned pointers and keeps slices in records, which the portable bundle subset does not allow yet. Xcoder checks object output against the git CLI and the sanitizer against gix-url on generated remotes.

License

BSD 3-Clause; see LICENSE.

S
Description
Git object and packfile handling with remote URL sanitization.
Readme BSD-3-Clause
51 KiB
0 Stars 1 Watchers 0 Forks