mirror of
https://github.com/martinvonz/jj.git
synced 2025-01-29 23:57:51 +00:00
merge_tools: check complexity of conflict before reading content
We can know before we read the content if the conflict is too complex for a merge tool to resolve.
This commit is contained in:
parent
de71df2447
commit
fb3f8b3bd3
1 changed files with 3 additions and 3 deletions
|
@ -173,14 +173,14 @@ pub fn run_mergetool(
|
|||
));
|
||||
}
|
||||
};
|
||||
let mut content = extract_file_conflict_as_single_hunk(tree.store(), repo_path, &file_conflict);
|
||||
// We only support conflicts with 2 sides (3-way conflicts)
|
||||
if content.adds.len() > 2 {
|
||||
if file_conflict.adds().len() > 2 {
|
||||
return Err(ConflictResolveError::ConflictTooComplicatedError {
|
||||
path: repo_path.clone(),
|
||||
sides: content.adds.len(),
|
||||
sides: file_conflict.adds().len(),
|
||||
});
|
||||
};
|
||||
let mut content = extract_file_conflict_as_single_hunk(tree.store(), repo_path, &file_conflict);
|
||||
|
||||
let editor = get_merge_tool_from_settings(ui, settings)?;
|
||||
let initial_output_content: Vec<u8> = if editor.merge_tool_edits_conflict_markers {
|
||||
|
|
Loading…
Reference in a new issue