bit_repo

Repository handle and materialization

git
repo
moon add mizchi/bit_repo@0.46.4
Download zip
Author
Version
0.46.4
License
Apache-2.0
Last updated
4 days ago
Downloads
567
README

#
CommitInfo

#
ObjectStore

pub struct ObjectStore {
objects : Map[String,
PackObject
]
}

#
ObjectStore::add_objects

fn ObjectStore::add_objects(self : ObjectStore, objects : Array[
PackObject
]) -> Unit

#
ObjectStore::contains

#
ObjectStore::from_pack

#
ObjectStore::new

#
checkout_commit

fn checkout_commit(store : ObjectStore, commit_id :
ObjectId
) -> Map[String, Bytes] raise
GitError

#
checkout_commit_to_fs

Materialize commit_id under root, producing an exact checkout: paths tracked by a prior checkout that are absent from this commit are removed. rfs must observe the same filesystem as fs (callers pass the same concrete value as both trait views).

#
checkout_commit_to_fs_async

Asynchronous counterpart to checkout_commit_to_fs.
fn is_gitlink_mode(mode : String) -> Bool

#
is_tree_mode

fn is_tree_mode(mode : String) -> Bool

#
join_path

fn join_path(root : String, path : String) -> String

#
materialize_clone_to_fs

fn materialize_clone_to_fs(store : ObjectStore, commit_id :
ObjectId
, refname : String, remote_url : String, fs : &
FileSystem
, root : String, rfs : &
RepoFileSystem
) -> Unit raise
GitError

#
materialize_clone_to_fs_async

async fn[FS :
AsyncFileSystem
+
AsyncRepoFileSystem
] materialize_clone_to_fs_async(store : ObjectStore, commit_id :
ObjectId
, refname : String, remote_url : String, fs : FS, root : String) -> Unit raise
GitError

Asynchronous counterpart to materialize_clone_to_fs.

#
parent_dir

fn parent_dir(path : String) -> String

#
parse_commit

fn parse_commit(content : Bytes) -> CommitInfo raise
GitError

#
read_shallow_boundaries

fn read_shallow_boundaries(fs : &
RepoFileSystem
, git_dir : String) -> Array[
ObjectId
]

#
verify_tree_entry_name

fn verify_tree_entry_name(name : String) -> Unit raise
GitError

Verify a single tree-entry name is safe to materialize into a worktree path.

Rejects: empty string, ., .., any name containing / or NUL, and .git case-insensitively (the canonical foothold for hooks, config, refs). Mirrors the subset of git's verify_path() that matters for path-traversal during checkout / clone / fetch.

Called at the bytes→worktree boundary (walk_tree_to_fs, lib.collect_tree_files_inner). Reading the bytes via @object.parse_tree is unaffected: a repo might still contain legacy commits with names we now reject, but bit refuses to materialize them. Use git fsck --strict upstream to catch the commit; bit will not silently write into .git/ or above the worktree.

#
write_git_metadata

fn write_git_metadata(store : ObjectStore, commit_id :
ObjectId
, refname : String, remote_url : String, fs : &
FileSystem
, root : String, rfs : &
RepoFileSystem
) -> Unit raise
GitError

#
write_git_metadata_async

async fn[FS :
AsyncFileSystem
+
AsyncRepoFileSystem
] write_git_metadata_async(store : ObjectStore, commit_id :
ObjectId
, refname : String, remote_url : String, fs : FS, root : String) -> Unit raise
GitError

Asynchronous counterpart to write_git_metadata.

Powered by MoonBit

Site sourceReport issuePackagesBuild queueSkillsStatistics

© 2026 mooncakes.io