Initializes a new git repository without any commits.
(&self)
| 105 | |
| 106 | /// Initializes a new git repository without any commits. |
| 107 | pub fn init(&self) -> Result<()> { |
| 108 | self.run_git_command(&["init"]) |
| 109 | .context("Failed to initialize git repository")?; |
| 110 | |
| 111 | // Set local git config to avoid using global config |
| 112 | self.run_git_command(&["config", "user.email", "test@example.com"])?; |
| 113 | self.run_git_command(&["config", "user.name", "Test User"])?; |
| 114 | |
| 115 | Ok(()) |
| 116 | } |
| 117 | |
| 118 | /// Initializes a new git repository with an initial commit. |
| 119 | /// Returns the commit SHA of the initial commit. |
no test coverage detected