MCPcopy Create free account
hub / github.com/atomicdotdev/atomic / root

Method root

atomic-core/src/record/item.rs:596–605  ·  view source on GitHub ↗

Create a record item for the repository root. This is a special item representing the root directory. # Example ```rust use atomic_core::record::RecordItem; use atomic_core::types::Inode; let root = RecordItem::root(); assert!(root.is_root()); assert_eq!(root.inode(), Inode::ROOT); ```

()

Source from the content-addressed store, hash-verified

594 /// assert_eq!(root.inode(), Inode::ROOT);
595 /// ```
596 pub fn root() -> Self {
597 Self {
598 path: PathBuf::new(),
599 basename: String::new(),
600 inode: Inode::ROOT,
601 parent_inode: Inode::ROOT,
602 parent_position: Position::ROOT,
603 metadata: FileMetadata::directory(),
604 }
605 }
606
607 /// Create a record item with full details.
608 ///

Callers 11

run_pushMethod · 0.45
apply_stashMethod · 0.45
add_pathMethod · 0.45
print_ignore_debugMethod · 0.45
import_branchMethod · 0.45
reindex_working_copyFunction · 0.45
add_dir_recursiveFunction · 0.45
import_branchMethod · 0.45
phase2_writeMethod · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected