MCPcopy Create free account
hub / github.com/GCWing/BitFun / get_git_diff

Method get_git_diff

src/apps/cli/src/modes/exec.rs:74–95  ·  view source on GitHub ↗
(&self)

Source from the content-addressed store, hash-verified

72 }
73
74 fn get_git_diff(&self) -> Option<String> {
75 let workspace = self.workspace_path.as_ref()?;
76
77 let git_dir = workspace.join(".git");
78 if !git_dir.exists() {
79 eprintln!("Warning: Workspace is not a git repository, cannot generate patch");
80 return None;
81 }
82
83 let output = bitfun_core::util::process_manager::create_command("git")
84 .args(["diff", "--no-color"])
85 .current_dir(workspace)
86 .output()
87 .ok()?;
88
89 if output.status.success() {
90 Some(String::from_utf8_lossy(&output.stdout).to_string())
91 } else {
92 eprintln!("Warning: git diff execution failed");
93 None
94 }
95 }
96
97 pub async fn run(&mut self) -> Result<()> {
98 tracing::info!(

Callers 1

Calls 6

outputMethod · 0.80
create_commandFunction · 0.50
joinMethod · 0.45
existsMethod · 0.45
okMethod · 0.45
successMethod · 0.45

Tested by

no test coverage detected