Rename information in header should only be shown on first hunk

Fixes #553
syntax_id
Wilfred Hughes 2023-08-11 08:21:29 +07:00
parent f2f9260542
commit 5f25bc0ebd
1 changed files with 2 additions and 2 deletions

@ -476,11 +476,11 @@ pub fn header(
}
match old_path {
Some(old_path) => {
Some(old_path) if hunk_num == 1 => {
let renamed = format!("Renamed from {} to {}", old_path, display_path);
format!("{}{}\n{}", display_path_pretty, trailer, renamed)
}
None => {
_ => {
format!("{}{}", display_path_pretty, trailer)
}
}