Add another repository as a git submodule at the given path.
(&self, source: &TestGitRepository, path: &str)
| 295 | |
| 296 | /// Add another repository as a git submodule at the given path. |
| 297 | pub fn add_submodule(&self, source: &TestGitRepository, path: &str) -> Result<()> { |
| 298 | self.run_git_command(&[ |
| 299 | "-c", |
| 300 | "protocol.file.allow=always", |
| 301 | "submodule", |
| 302 | "add", |
| 303 | source |
| 304 | .path() |
| 305 | .to_str() |
| 306 | .ok_or_else(|| anyhow::anyhow!("Invalid source path"))?, |
| 307 | path, |
| 308 | ])?; |
| 309 | Ok(()) |
| 310 | } |
| 311 | |
| 312 | /// Runs a git command in the repository directory. |
| 313 | pub fn run_git_command(&self, args: &[&str]) -> Result<String> { |
no test coverage detected