Skip to main content

amiss_git/
lib.rs

1mod handle;
2pub mod index;
3pub mod object;
4mod pack;
5pub mod repo;
6pub mod resources;
7
8pub use index::{IndexEntry, LogicalIndex, parse_index_file};
9pub use object::{Commit, Object, ObjectKind, TreeEntry, parse_commit, parse_tree};
10pub use repo::Repository;
11pub use resources::{GitLimits, GitResources, ValueCap};
12
13use amiss_wire::controls::ResourceName;
14
15/// The spec requires that a platform which cannot enforce the handle/no-follow
16/// boundary report the repository unavailable rather than fall back to
17/// pathname traversal. Unix and Windows both enforce it, so the crate refuses
18/// to build anywhere else instead of shipping a fallback that could be reached
19/// by accident. A build that cannot hold the boundary does not exist.
20#[cfg(not(any(unix, windows)))]
21compile_error!(
22    "amiss-git holds every object behind a directory handle that is never followed; no other platform provides one"
23);
24
25#[derive(Clone, Debug, PartialEq, Eq)]
26pub enum Error {
27    RepositoryUnavailable,
28    ObjectMissing,
29    ObjectWrongKind,
30    ObjectUnreadable,
31    IndexInvalid,
32    IndexUnmerged,
33    IntentToAdd,
34    SnapshotChanged,
35    ResourceLimit {
36        resource: ResourceName,
37        configured_limit: u64,
38        observed_lower_bound: u64,
39    },
40}