MCPcopy Index your code
hub / github.com/AI45Lab/Code / stash

Function stash

core/src/git.rs:660–675  ·  view source on GitHub ↗

Create a stash.

(repo_path: &Path, message: Option<&str>, include_untracked: bool)

Source from the content-addressed store, hash-verified

658
659/// Create a stash.
660pub fn stash(repo_path: &Path, message: Option<&str>, include_untracked: bool) -> Result<()> {
661 let mut args = vec!["stash", "push"];
662 if include_untracked {
663 args.push("-u");
664 }
665 if let Some(msg) = message {
666 args.push("-m");
667 args.push(msg);
668 }
669
670 let (success, _, stderr) = run_git(repo_path, &args)?;
671 if !success {
672 return Err(anyhow!("Failed to stash: {}", stderr));
673 }
674 Ok(())
675}

Callers 1

stashMethod · 0.85

Calls 1

run_gitFunction · 0.85

Tested by

no test coverage detected