Initializes a new git repository with an initial commit. Returns the commit SHA of the initial commit.
(&self)
| 118 | /// Initializes a new git repository with an initial commit. |
| 119 | /// Returns the commit SHA of the initial commit. |
| 120 | pub fn init_with_commit(&self) -> Result<String> { |
| 121 | self.init()?; |
| 122 | |
| 123 | // Create an initial file |
| 124 | self.create_file("README.md", "# Test Repository\n")?; |
| 125 | self.stage_all()?; |
| 126 | self.commit("Initial commit") |
| 127 | } |
| 128 | |
| 129 | /// Creates a file in the repository with the given content. |
| 130 | pub fn create_file(&self, path: &str, content: &str) -> Result<()> { |
no test coverage detected