From a5ef4f0f4088d1a38d3630225e3d191b45bd36a6 Mon Sep 17 00:00:00 2001 From: Martin von Zweigbergk Date: Tue, 30 May 2023 17:08:01 -0700 Subject: [PATCH] merge_tools: avoid re-reading edited file, read from buffer instead I suspect this was just because it wasn't obvious to the author how to get a `Read` from an in-memory buffer (I know it wasn't to me). --- src/merge_tools.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/merge_tools.rs b/src/merge_tools.rs index c37fd91d9..290231170 100644 --- a/src/merge_tools.rs +++ b/src/merge_tools.rs @@ -271,7 +271,7 @@ pub fn run_mergetool( let new_tree_value = new_tree_value.unwrap_or({ let new_file_id = tree .store() - .write_file(repo_path, &mut File::open(paths.get("output").unwrap())?)?; + .write_file(repo_path, &mut output_file_contents.as_slice())?; TreeValue::File { id: new_file_id, executable: false,