1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
// The crate is safe Rust everywhere. The `ffi` feature adds a C ABI, which is
// unavoidably `unsafe` (raw pointers, `extern "C"`), so it downgrades the
// crate-wide ban to `deny` and confines the `unsafe` to the audited `ffi`
// module (which alone opts in with `#![allow(unsafe_code)]`). Without `ffi`, the
// stronger `forbid` still applies and no `unsafe` can appear anywhere.
//! puregit — a pure-Rust implementation of git.
//!
//! In the spirit of `libgit2`, but written from scratch in safe Rust and built
//! on [`purecrypto`] for hashing and [`compcol`] for zlib, with no foreign code
//! in the dependency tree. The crate covers the full local object engine, the
//! packfile format, references, the staging index, and the *smart* transport
//! used by `git fetch`/`git push` — as both a client and a server, over HTTP
//! and SSH.
//!
//! # Layering
//!
//! The library is deliberately split into a `no_std + alloc` **core** and a
//! `std` **shell**:
//!
//! ```text
//! ┌───────────────────────────────────────────────────────────────┐
//! │ std shell (feature `std`) │
//! │ vfs::StdFs · Repository · worktree · transport::{http,ssh} │
//! └───────────────────────────────────────────────────────────────┘
//! ┌───────────────────────────────────────────────────────────────┐
//! │ no_std + alloc core │
//! │ oid · hash · object · odb · pack · refs · index · config │
//! │ protocol (pkt-line, capabilities, fetch/push negotiation) │
//! └───────────────────────────────────────────────────────────────┘
//! ```
//!
//! Nothing in the core names `std`: it transforms byte buffers and is driven by
//! the caller's I/O. The [`vfs`] trait abstracts the filesystem so the same
//! repository logic runs over the real disk (`vfs::StdFs`, feature `std`), an
//! in-memory store, or any custom backend.
//!
//! # Sans-IO transport
//!
//! Like the sibling `puressh`/`rsurl` crates, the wire protocols are *sans-IO*:
//! the [`protocol`] negotiation drivers consume inbound bytes and produce
//! outbound frames and events, while the caller owns the socket and the clock.
//! Two transport frontends drive that one core — `transport::http` (feature
//! `http`, over `rsurl`) and `transport::ssh` (feature `ssh`, over
//! `puressh`) — sharing all protocol logic.
//!
//! # Module map
//!
//! Core (always built):
//! - [`error`] — the crate-wide [`Error`] / [`Result`] types.
//! - [`oid`] — [`ObjectId`], git's SHA-1 / SHA-256 content name.
//! - [`hash`] — compute an [`ObjectId`] from object bytes.
//! - [`object`] — the object model: blob, [`tree`](object::tree),
//! [`commit`](object::commit), [`tag`](object::tag); loose-object framing.
//! - [`odb`] — the [`ObjectDatabase`](odb::ObjectDatabase) trait and the
//! loose-object backend.
//! - [`pack`] — packfile parsing/writing and delta resolution.
//! - [`refs`] — reference names, the ref store, packed-refs, symrefs.
//! - [`index`] — the staging index (`.git/index`).
//! - [`config`] — the git config (`.git/config`) parser.
//! - [`protocol`] — pkt-line framing, capabilities, and the sans-IO
//! fetch/push negotiation state machines.
//!
//! Shell (feature `std`):
//! - [`vfs`] — the filesystem abstraction and its std backend.
//! - `repository` — `Repository`, the on-disk repo tying it all together.
//! - `worktree` — working-tree checkout, status, and diff.
//! - `transport` — the HTTP and SSH smart-transport frontends (features
//! `http` / `ssh`).
//! - `server` — `upload-pack` / `receive-pack` request handlers
//! (feature `server`).
//!
//! [`purecrypto`]: https://crates.io/crates/purecrypto
//! [`compcol`]: https://crates.io/crates/compcol
extern crate alloc;
// ---- core (no_std + alloc) -------------------------------------------------
// ---- std shell -------------------------------------------------------------
// ---- re-exports ------------------------------------------------------------
pub use crate;
pub use crate;
pub use crate;
pub use crateRepository;