@@ -95,15 +95,19 @@
     let output = child.output().await.context("reading git blame output")?;

     if !output.status.success() {
-        let stderr = String::from_utf8_lossy(&output.stderr);
-        let trimmed = stderr.trim();
-        if trimmed == GIT_BLAME_NO_COMMIT_ERROR || trimmed.contains(GIT_BLAME_NO_PATH) {
-            return Ok(String::new());
-        }
-        anyhow::bail!("git blame process failed: {stderr}");
+            return handle_command_output(output);
     }

     Ok(String::from_utf8(output.stdout)?)
+}
+
+fn handle_command_output(output: std::process::Output) -> Result<String> {
+    let stderr = String::from_utf8_lossy(&output.stderr);
+    let trimmed = stderr.trim();
+    if trimmed == GIT_BLAME_NO_COMMIT_ERROR || trimmed.contains(GIT_BLAME_NO_PATH) {
+        return Ok(String::new());
+    }
+    anyhow::bail!("git blame process failed: {stderr}");
 }

 #[derive(Serialize, Deserialize, Default, Debug, Clone, PartialEq, Eq)]
