@@ -93,7 +93,12 @@
     stdin.flush().await?;

     let output = child.output().await.context("reading git blame output")?;
+    handle_command_output(&output)?;

+    Ok(String::from_utf8(output.stdout)?)
+}
+
+fn handle_command_output(output: &std::process::Output) -> Result<String> {
     if !output.status.success() {
         let stderr = String::from_utf8_lossy(&output.stderr);
         let trimmed = stderr.trim();
@@ -102,8 +107,7 @@
         }
         anyhow::bail!("git blame process failed: {stderr}");
     }
-
-    Ok(String::from_utf8(output.stdout)?)
+    Ok(String::from_utf8_lossy(&output.stdout).into_owned())
 }

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