pub struct RepoLayout { /* private fields */ }Expand description
Resolved repository layout: worktree root plus the two state directories (see the module docs for the classification table).
Cheap to clone; construction never touches the filesystem.
Implementations§
Source§impl RepoLayout
impl RepoLayout
Sourcepub fn single(worktree_root: impl Into<PathBuf>) -> Self
pub fn single(worktree_root: impl Into<PathBuf>) -> Self
Layout of a classic single-worktree repository rooted at
worktree_root: common dir and worktree state dir are both
<worktree_root>/.mkit.
Sourcepub fn worktree_root(&self) -> &Path
pub fn worktree_root(&self) -> &Path
The working-tree root (directory whose files are under version control).
Sourcepub fn common_dir(&self) -> &Path
pub fn common_dir(&self) -> &Path
Shared state directory. Everything in it is common to all working trees of the repository.
Sourcepub fn worktree_state_dir(&self) -> &Path
pub fn worktree_state_dir(&self) -> &Path
Per-worktree state directory. Everything in it belongs to this working tree only.
Sourcepub fn is_single(&self) -> bool
pub fn is_single(&self) -> bool
true when common dir and worktree state dir coincide (the
classic single-worktree layout).
Sourcepub fn linked(
worktree_root: impl Into<PathBuf>,
worktree_state_dir: impl Into<PathBuf>,
common_dir: impl Into<PathBuf>,
) -> Self
pub fn linked( worktree_root: impl Into<PathBuf>, worktree_state_dir: impl Into<PathBuf>, common_dir: impl Into<PathBuf>, ) -> Self
Layout of a linked working tree (#493 Phase 1): working files at
worktree_root, per-tree state in worktree_state_dir (a
worktrees/<id> dir under the main repository’s common dir),
shared state in common_dir.
Pure construction — no filesystem access, no validation beyond
types. Production code obtains linked layouts via discover,
which validates the on-disk pointers; this constructor is the
seam discover and worktree add build on.
Sourcepub fn worktrees_dir(&self) -> PathBuf
pub fn worktrees_dir(&self) -> PathBuf
worktrees/ — the common-dir directory holding every linked
tree’s per-tree state dir.
Sourcepub fn worktree_state_dir_for(&self, id: &str) -> PathBuf
pub fn worktree_state_dir_for(&self, id: &str) -> PathBuf
The per-tree state dir a linked worktree with id would use:
worktrees/<id> under the common dir. The caller must have
validated id via validate_worktree_id.
Sourcepub fn objects_dir(&self) -> PathBuf
pub fn objects_dir(&self) -> PathBuf
objects/ — the content-addressed object store.
Sourcepub fn format_file(&self) -> PathBuf
pub fn format_file(&self) -> PathBuf
format — the object-addressing format marker.
refs/tags/ — tag refs.
Sourcepub fn remotes_dir(&self) -> PathBuf
pub fn remotes_dir(&self) -> PathBuf
refs/remotes/ — remote-tracking refs.
Sourcepub fn shallow_file(&self) -> PathBuf
pub fn shallow_file(&self) -> PathBuf
shallow — the shallow-clone boundary. Shared: it constrains
the one object graph every worktree reads.
Sourcepub fn config_file(&self) -> PathBuf
pub fn config_file(&self) -> PathBuf
config — the repository config file.
Sourcepub fn history_dir(&self) -> PathBuf
pub fn history_dir(&self) -> PathBuf
history/ — the append-only commit-history MMR.
Sourcepub fn recovery_log_file(&self) -> PathBuf
pub fn recovery_log_file(&self) -> PathBuf
recovery-log — the append-only superseded-commit log.
Sourcepub fn attestations_dir(&self) -> PathBuf
pub fn attestations_dir(&self) -> PathBuf
attestations/ — the DSSE attestation store.
Sourcepub fn applied_packs_dir(&self) -> PathBuf
pub fn applied_packs_dir(&self) -> PathBuf
applied-packs/ — per-remote applied-pack records. A
redownload-avoidance cache; never a gc root source, always safe
to delete.
Sourcepub fn git_state_dir(&self) -> PathBuf
pub fn git_state_dir(&self) -> PathBuf
git/ — git-bridge per-remote state.
Sourcepub fn sparse_cache_dir(&self) -> PathBuf
pub fn sparse_cache_dir(&self) -> PathBuf
sparse/ — the verifiable sparse-checkout bitmap cache
(keyed by tree hash, so shared).
Sourcepub fn pack_shards_dir(&self) -> PathBuf
pub fn pack_shards_dir(&self) -> PathBuf
pack-shards/ — default output directory for pack shards.
Sourcepub fn head_file(&self) -> PathBuf
pub fn head_file(&self) -> PathBuf
HEAD — this worktree’s checked-out branch or detached commit.
Sourcepub fn index_file(&self) -> PathBuf
pub fn index_file(&self) -> PathBuf
index — this worktree’s staging index.
Sourcepub fn orig_head_file(&self) -> PathBuf
pub fn orig_head_file(&self) -> PathBuf
ORIG_HEAD — pre-operation HEAD snapshot.
Sourcepub fn merge_head_file(&self) -> PathBuf
pub fn merge_head_file(&self) -> PathBuf
MERGE_HEAD — in-progress merge counterpart commit.
Sourcepub fn merge_msg_file(&self) -> PathBuf
pub fn merge_msg_file(&self) -> PathBuf
MERGE_MSG — in-progress merge message.
Sourcepub fn cherry_pick_head_file(&self) -> PathBuf
pub fn cherry_pick_head_file(&self) -> PathBuf
CHERRY_PICK_HEAD — in-progress cherry-pick source commit.
Sourcepub fn cherry_pick_msg_file(&self) -> PathBuf
pub fn cherry_pick_msg_file(&self) -> PathBuf
CHERRY_PICK_MSG — in-progress cherry-pick message.
Sourcepub fn revert_head_file(&self) -> PathBuf
pub fn revert_head_file(&self) -> PathBuf
REVERT_HEAD — in-progress revert source commit.
Sourcepub fn revert_msg_file(&self) -> PathBuf
pub fn revert_msg_file(&self) -> PathBuf
REVERT_MSG — in-progress revert message.
Sourcepub fn conflicts_file(&self) -> PathBuf
pub fn conflicts_file(&self) -> PathBuf
mkit-conflicts — conflict sidecar for the in-progress op.
Sourcepub fn result_tree_file(&self) -> PathBuf
pub fn result_tree_file(&self) -> PathBuf
MKIT_OP_RESULT — full result tree of the in-progress op.
Sourcepub fn rebase_dir(&self) -> PathBuf
pub fn rebase_dir(&self) -> PathBuf
rebase-apply/ — in-progress rebase state.
Sourcepub fn bisect_file(&self) -> PathBuf
pub fn bisect_file(&self) -> PathBuf
bisect — in-progress bisect state.
Sourcepub fn stash_file(&self) -> PathBuf
pub fn stash_file(&self) -> PathBuf
stash — this worktree’s stash manifest (tree-local by #493).
Sourcepub fn sparse_checkout_file(&self) -> PathBuf
pub fn sparse_checkout_file(&self) -> PathBuf
sparse-checkout — this worktree’s sparse filter spec.
Trait Implementations§
Source§impl Clone for RepoLayout
impl Clone for RepoLayout
Source§fn clone(&self) -> RepoLayout
fn clone(&self) -> RepoLayout
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for RepoLayout
impl Debug for RepoLayout
impl Eq for RepoLayout
Source§impl PartialEq for RepoLayout
impl PartialEq for RepoLayout
impl StructuralPartialEq for RepoLayout
Auto Trait Implementations§
impl Freeze for RepoLayout
impl RefUnwindSafe for RepoLayout
impl Send for RepoLayout
impl Sync for RepoLayout
impl Unpin for RepoLayout
impl UnsafeUnpin for RepoLayout
impl UnwindSafe for RepoLayout
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<T> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
Source§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
impl<A, B, T> HttpServerConnExec<A, B> for Twhere
B: Body,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more