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

Function add_all

src/git_operations.rs:78–101  ·  view source on GitHub ↗
(repo_path: &Path)

Source from the content-addressed store, hash-verified

76}
77
78pub async fn add_all(repo_path: &Path) -> Result<(), String> {
79 tokio::task::spawn_blocking({
80 let repo_path = repo_path.to_owned();
81 move || -> Result<(), String> {
82 let output = std::process::Command::new("git")
83 .current_dir(&repo_path)
84 .arg("add")
85 .arg("-A")
86 .output()
87 .map_err(|e| format!("Failed to execute git add: {e}"))?;
88
89 if !output.status.success() {
90 return Err(format!(
91 "Failed to add files to index: {}",
92 String::from_utf8_lossy(&output.stderr)
93 ));
94 }
95
96 Ok(())
97 }
98 })
99 .await
100 .map_err(|e| format!("Task join error: {e}"))?
101}
102
103/// Re-normalizes the index so that clean/smudge filters (e.g. git-lfs) are
104/// re-applied. This fixes stat-cache mismatches after overlaying working

Callers 3

commit_changesMethod · 0.85

Calls 1

successMethod · 0.80

Tested by 1