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:
parent
9746f4f267
commit
5ef75919f0
1 changed files with 4 additions and 0 deletions
|
@ -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");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue