Skip to content

Commit

Permalink
local_working_copy: move comment about conflict file to the right place
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
yuja committed Nov 27, 2024
1 parent e41ffa7 commit 8e54e3e
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions lib/src/local_working_copy.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1315,8 +1315,6 @@ impl TreeState {
executable: FileExecutableFlag,
conflict_marker_style: ConflictMarkerStyle,
) -> Result<MergedTreeValue, SnapshotError> {
// 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
Expand All @@ -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(),
Expand Down

0 comments on commit 8e54e3e

Please sign in to comment.