git: Do not log error if repository has no commits (#11163)

This is a follow-up to #10685 which started to hide these errors instead
of displaying them to the user.

But the errors are still noisy and not actionable, so we hide them
instead.

Release Notes:

- Removed error message being logged when `git blame` is run in a
repository without commits.

Co-authored-by: Bennet <bennetbo@gmx.de>
This commit is contained in:
Thorsten Ball 2024-04-29 16:00:29 +02:00 committed by GitHub
parent 9746f4f267
commit 5ef75919f0
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -8,6 +8,10 @@ use std::process::Command;
use std::os::windows::process::CommandExt;
pub fn get_messages(working_directory: &Path, shas: &[Oid]) -> Result<HashMap<Oid, String>> {
if shas.is_empty() {
return Ok(HashMap::default());
}
const MARKER: &'static str = "<MARKER>";
let mut command = Command::new("git");