mirror of
https://github.com/martinvonz/jj.git
synced 2025-02-07 21:27:06 +00:00
merge_tools: don't enable fsmonitor (and file size limit) in temporary snapshot
Because the snapshot directory is removed at the end of the function, it doesn't make sense to enable watchman in it. The max_new_file_size parameter might be somewhat useful, but it's unlikely that the temporary directory contains gigantic node_modules tree for example. OTOH, the base_ignores matters since it may contain common ignore patterns like *~. This eliminates most of the UserSettings dependencies from this function.
This commit is contained in:
parent
2a3b0eeaec
commit
51496de9fb
1 changed files with 4 additions and 2 deletions
|
@ -10,6 +10,7 @@ use futures::StreamExt;
|
||||||
use itertools::Itertools;
|
use itertools::Itertools;
|
||||||
use jj_lib::backend::{FileId, MergedTreeId, TreeValue};
|
use jj_lib::backend::{FileId, MergedTreeId, TreeValue};
|
||||||
use jj_lib::conflicts::{self, materialize_merge_result};
|
use jj_lib::conflicts::{self, materialize_merge_result};
|
||||||
|
use jj_lib::fsmonitor::FsmonitorKind;
|
||||||
use jj_lib::gitignore::GitIgnoreFile;
|
use jj_lib::gitignore::GitIgnoreFile;
|
||||||
use jj_lib::local_working_copy::{TreeState, TreeStateError};
|
use jj_lib::local_working_copy::{TreeState, TreeStateError};
|
||||||
use jj_lib::matchers::Matcher;
|
use jj_lib::matchers::Matcher;
|
||||||
|
@ -516,14 +517,15 @@ diff editing in mind and be a little inaccurate.
|
||||||
std::fs::remove_file(instructions_path_to_cleanup).ok();
|
std::fs::remove_file(instructions_path_to_cleanup).ok();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Snapshot changes in the temporary output directory.
|
||||||
let mut output_tree_state = diff_wc
|
let mut output_tree_state = diff_wc
|
||||||
.output_tree_state
|
.output_tree_state
|
||||||
.unwrap_or(diff_wc.right_tree_state);
|
.unwrap_or(diff_wc.right_tree_state);
|
||||||
output_tree_state.snapshot(SnapshotOptions {
|
output_tree_state.snapshot(SnapshotOptions {
|
||||||
base_ignores,
|
base_ignores,
|
||||||
fsmonitor_kind: settings.fsmonitor_kind()?,
|
fsmonitor_kind: FsmonitorKind::None,
|
||||||
progress: None,
|
progress: None,
|
||||||
max_new_file_size: settings.max_new_file_size()?,
|
max_new_file_size: u64::MAX,
|
||||||
})?;
|
})?;
|
||||||
Ok(output_tree_state.current_tree_id().clone())
|
Ok(output_tree_state.current_tree_id().clone())
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue