From 8e54e3e70eb8f8ef60efdf8e3f180a920bf1d02d Mon Sep 17 00:00:00 2001 From: Yuya Nishihara Date: Wed, 27 Nov 2024 10:55:08 +0900 Subject: [PATCH] local_working_copy: move comment about conflict file to the right place I also removed "now" from "is now a normal file" because conflicts should be materialized as a normal file. "is a normal file" is tested by caller. --- lib/src/local_working_copy.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/src/local_working_copy.rs b/lib/src/local_working_copy.rs index 6ea1ab092e..3a24073694 100644 --- a/lib/src/local_working_copy.rs +++ b/lib/src/local_working_copy.rs @@ -1315,8 +1315,6 @@ impl TreeState { executable: FileExecutableFlag, conflict_marker_style: ConflictMarkerStyle, ) -> Result { - // If the file contained a conflict before and is now a normal file on disk, we - // try to parse any conflict markers in the file into a conflict. if let Some(current_tree_value) = current_tree_values.as_resolved() { #[cfg(unix)] let _ = current_tree_value; // use the variable @@ -1333,6 +1331,9 @@ impl TreeState { }; Ok(Merge::normal(TreeValue::File { id, executable })) } else if let Some(old_file_ids) = current_tree_values.to_file_merge() { + // If the file contained a conflict before and is a normal file on + // disk, we try to parse any conflict markers in the file into a + // conflict. let content = fs::read(disk_path).map_err(|err| SnapshotError::Other { message: format!("Failed to open file {}", disk_path.display()), err: err.into(),