(&self)
| 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!( |
no test coverage detected