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

Method existing_git_history

atomic-cli/tests/it/git_shim_opt_in_test.rs:44–59  ·  view source on GitHub ↗

An existing Git repository with one commit, then `atomic init`.

()

Source from the content-addressed store, hash-verified

42
43 /// An existing Git repository with one commit, then `atomic init`.
44 fn existing_git_history() -> Self {
45 let fixture = Self {
46 repository: TempDir::new().expect("repository tempdir"),
47 home: TempDir::new().expect("home tempdir"),
48 };
49 fixture.git_ok(&["init", "-q", "-b", "main"]);
50 fixture.git_ok(&["config", "user.name", "Opt-in Tests"]);
51 fixture.git_ok(&["config", "user.email", "opt-in@example.com"]);
52 fixture.git_ok(&["config", "commit.gpgsign", "false"]);
53 fixture.git_ok(&["config", "core.autocrlf", "false"]);
54 fs::write(fixture.root().join("base.txt"), b"base\n").unwrap();
55 fixture.git_ok(&["add", "base.txt"]);
56 fixture.git_ok(&["commit", "--no-gpg-sign", "-q", "-m", "base"]);
57 fixture.atomic_ok(&["init", "--no-vault", "--view", "main"]);
58 fixture
59 }
60
61 fn root(&self) -> &Path {
62 self.repository.path()

Callers

nothing calls this directly

Calls 5

writeFunction · 0.70
git_okMethod · 0.45
unwrapMethod · 0.45
rootMethod · 0.45
atomic_okMethod · 0.45

Tested by

no test coverage detected