MCPcopy Create free account
hub / github.com/dtormoen/tsk-tsk / add_submodule

Method add_submodule

src/test_utils/git_test_utils.rs:297–310  ·  view source on GitHub ↗

Add another repository as a git submodule at the given path.

(&self, source: &TestGitRepository, path: &str)

Source from the content-addressed store, hash-verified

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> {

Calls 2

run_git_commandMethod · 0.80
pathMethod · 0.80

Tested by

no test coverage detected