An existing Git repository with one commit, then `atomic init`.
()
| 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() |