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

Function fixture_repo

atomic-repository/src/repository/ref_mapping.rs:641–650  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

639 use git2::Signature;
640
641 fn fixture_repo() -> (tempfile::TempDir, GitRepository) {
642 let dir = tempfile::TempDir::new().unwrap();
643 let git = GitRepository::init(dir.path()).unwrap();
644 {
645 let mut config = git.config().unwrap();
646 config.set_str("user.name", "CB-10A Tests").unwrap();
647 config.set_str("user.email", "cb10a@example.com").unwrap();
648 }
649 (dir, git)
650 }
651
652 fn commit_on(git: &GitRepository, message: &str, parents: &[git2::Oid]) -> git2::Oid {
653 let tree_id = if parents.is_empty() {

Calls 3

initFunction · 0.50
unwrapMethod · 0.45
pathMethod · 0.45