Store goldenfiles with trailing newline (#10900)

Thorsten Ball created

Release Notes:


- N/A

Change summary

crates/git/src/blame.rs                                          | 4 +
crates/git/test_data/golden/blame_incremental_complex.json       | 2 
crates/git/test_data/golden/blame_incremental_not_committed.json | 2 
crates/git/test_data/golden/blame_incremental_simple.json        | 2 
4 files changed, 6 insertions(+), 4 deletions(-)

Detailed changes

crates/git/src/blame.rs 🔗

@@ -336,8 +336,10 @@ mod tests {
         path.push("golden");
         path.push(format!("{}.json", golden_filename));
 
-        let have_json =
+        let mut have_json =
             serde_json::to_string_pretty(&entries).expect("could not serialize entries to JSON");
+        // We always want to save with a trailing newline.
+        have_json.push('\n');
 
         let update = std::env::var("UPDATE_GOLDEN")
             .map(|val| val.to_ascii_lowercase() == "true")