1#![deny(unsafe_code)]
16#![allow(clippy::multiple_crate_versions)]
21
22pub mod chunker;
23pub mod delta;
24pub mod hash;
25pub mod object;
26pub mod ops;
27pub mod pack;
28#[cfg(feature = "pack-shards")]
36pub mod pack_shard;
37pub mod serialize;
38pub mod sign;
39pub mod store;
40
41pub(crate) mod atomic;
43pub mod ignore;
44pub mod index;
45pub mod refs;
46pub mod repo_lock;
47pub mod worktree;
48
49pub mod protocol;
51
52#[cfg(feature = "history-mmr")]
58pub mod history;
59
60#[cfg(feature = "sparse-checkout")]
65pub mod sparse;
66
67#[cfg(feature = "sparse-checkout")]
68pub use sparse::{
69 MAX_FILTER_PATHS as SPARSE_MAX_FILTER_PATHS, MAX_LEAVES as SPARSE_MAX_LEAVES, SPARSE_CACHE_DIR,
70 SPARSE_CACHE_MAGIC, SPARSE_CACHE_VERSION, SPARSE_WIRE_MAGIC, SPARSE_WIRE_MAX_BYTES,
71 SPARSE_WIRE_VERSION, SparseError, SparseManifest, SparseProof, SparseResponse, SparseWireError,
72 build_sparse, decode_sparse_cache, decode_sparse_response, encode_sparse_cache,
73 encode_sparse_response, hash_filter, verify_sparse,
74};
75
76pub use hash::{HASH_LEN, HEX_LEN, Hash, Hasher, to_hex, to_hex_bytes};
77pub use object::{
78 Blob, ChunkedBlob, Commit, Delta, EntryMode, IDENTITY_MAX_LEN, Identity, IdentityKind, MAGIC,
79 MkitError, Object, ObjectType, Remix, RemixSource, SCHEMA_VERSION, TAG_NAME_MAX_LEN, Tag, Tree,
80 TreeEntry,
81};
82pub use serialize::{deserialize, serialize};
83pub use sign::{
84 COMMIT_DOMAIN, KeyPair, PublicKey, REMIX_DOMAIN, SecretSeed, Signature, TAG_DOMAIN,
85 commit_signing_bytes, commit_signing_hash, remix_signing_bytes, remix_signing_hash,
86 sign_commit, sign_remix, sign_tag, tag_signing_bytes, tag_signing_hash, verify, verify_commit,
87 verify_remix, verify_tag,
88};
89pub use store::{
90 MAX_RAW_OBJECT_SIZE, MAX_TREE_DEPTH, MKIT_DIR, OBJECTS_DIR, ObjectStore, StoreError,
91 StoreResult,
92};
93
94pub use chunker::{
96 AVG_SIZE as CHUNK_AVG_SIZE, ChunkBoundary, ChunkIterator, FastCdc, MASK_L as CHUNK_MASK_L,
97 MASK_S as CHUNK_MASK_S, MAX_SIZE as CHUNK_MAX_SIZE, MIN_SIZE as CHUNK_MIN_SIZE,
98 SEED as CHUNK_SEED, chunk_boundaries, gear_table_digest,
99};
100
101pub use delta::{HEADER_LEN as DELTA_HEADER_LEN, MAX_INSERT_LEN, OP_COPY, STREAM_VERSION};
103
104pub use pack::{
106 HEADER_LEN as PACK_HEADER_LEN, MAGIC as PACK_MAGIC, MAX_ENTRIES as PACK_MAX_ENTRIES,
107 MAX_TOTAL_PAYLOAD as PACK_MAX_TOTAL_PAYLOAD, PackError, PackReader, PackWriter,
108 TRAILER_LEN as PACK_TRAILER_LEN, UnpackReport, VERSION as PACK_VERSION, pack_key,
109};
110
111pub use ignore::{IgnoreError, IgnoreList, MAX_IGNORE_FILE_BYTES, Pattern, glob_match};
113pub use index::{
114 EntryStatus, INDEX_FILE, Index, IndexEntry, IndexError, IndexResult, MAGIC as INDEX_MAGIC,
115 MAX_INDEX_BYTES, MAX_PATH_LEN, validate_index_path,
116};
117pub use refs::{
118 HEAD_FILE, HEADS_DIR, Head, REFS_DIR, Ref, RefError, RefResult, RefWriteCondition,
119 SHALLOW_FILE, TAGS_DIR, decode_ref_wire, encode_ref_wire, validate_ref_name,
120 validate_ref_prefix,
121};
122pub use repo_lock::{DEFAULT_TIMEOUT as LOCK_DEFAULT_TIMEOUT, LockError, LockResult, RepoLock};
123pub use worktree::{
124 CHUNK_THRESHOLD, MAX_FILE_BYTES, WorktreeError, WorktreeResult, read_blob, store_file_object,
125 validate_symlink_target,
126};
127
128pub use protocol::{
132 BACKOFF_CAP, BACKOFF_INITIAL, BACKOFF_MAX_ATTEMPTS, BackoffIterator, PackKey, Transport,
133 TransportError, TransportResult, is_retryable, pack_key_from_hex,
134};
135
136pub use ops::{
142 CherryPickError, CherryPickResult, Conflict, ConflictKind, DiffEntry, DiffError, DiffKind,
143 DiffResult, MergeResult, StatusEntry, StatusStaging, cherry_pick, collect_ancestor_set,
144 diff_trees, find_merge_base, is_ancestor, merge_trees, status_diff,
145};