Skip to content

Commit

Permalink
merge_tools: don't enable fsmonitor (and file size limit) in temporar…
Browse files Browse the repository at this point in the history
…y snapshot

Because the snapshot directory will be removed soon, 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.
  • Loading branch information
yuja committed Mar 1, 2024
1 parent 82b3017 commit 1789edc
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions cli/src/merge_tools/external.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ use futures::StreamExt;
use itertools::Itertools;
use jj_lib::backend::{FileId, MergedTreeId, TreeValue};
use jj_lib::conflicts::{self, materialize_merge_result};
use jj_lib::fsmonitor::FsmonitorKind;
use jj_lib::gitignore::GitIgnoreFile;
use jj_lib::local_working_copy::{TreeState, TreeStateError};
use jj_lib::matchers::Matcher;
Expand Down Expand Up @@ -516,14 +517,15 @@ diff editing in mind and be a little inaccurate.
std::fs::remove_file(instructions_path_to_cleanup).ok();
}

// Snapshot changes in the temporary output directory.
let mut output_tree_state = diff_wc
.output_tree_state
.unwrap_or(diff_wc.right_tree_state);
output_tree_state.snapshot(SnapshotOptions {
base_ignores,
fsmonitor_kind: settings.fsmonitor_kind()?,
fsmonitor_kind: FsmonitorKind::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())
}
Expand Down

0 comments on commit 1789edc

Please sign in to comment.