ok/jj
1
0
Fork 0
forked from mirrors/jj

working_copy: rename WorkItem -> DirectoryToVisit

This commit is contained in:
Waleed Khan 2023-08-03 08:23:59 -07:00 committed by Martin von Zweigbergk
parent 16ef3f7edc
commit e1c194ce67

View file

@ -386,7 +386,7 @@ pub enum ResetError {
TreeStateError(#[from] TreeStateError), TreeStateError(#[from] TreeStateError),
} }
struct WorkItem { struct DirectoryToVisit {
dir: RepoPath, dir: RepoPath,
disk_dir: PathBuf, disk_dir: PathBuf,
git_ignore: Arc<GitIgnoreFile>, git_ignore: Arc<GitIgnoreFile>,
@ -651,7 +651,7 @@ impl TreeState {
}); });
let matcher = IntersectionMatcher::new(sparse_matcher.as_ref(), fsmonitor_matcher); let matcher = IntersectionMatcher::new(sparse_matcher.as_ref(), fsmonitor_matcher);
let work_item = WorkItem { let directory_to_visit = DirectoryToVisit {
dir: RepoPath::root(), dir: RepoPath::root(),
disk_dir: self.working_copy_path.clone(), disk_dir: self.working_copy_path.clone(),
git_ignore: base_ignores, git_ignore: base_ignores,
@ -667,7 +667,7 @@ impl TreeState {
tree_entries_tx, tree_entries_tx,
file_states_tx, file_states_tx,
deleted_files_tx, deleted_files_tx,
work_item, directory_to_visit,
progress, progress,
)?; )?;
@ -702,14 +702,14 @@ impl TreeState {
tree_entries_tx: Sender<(RepoPath, TreeValue)>, tree_entries_tx: Sender<(RepoPath, TreeValue)>,
file_states_tx: Sender<(RepoPath, FileState)>, file_states_tx: Sender<(RepoPath, FileState)>,
deleted_files_tx: Sender<RepoPath>, deleted_files_tx: Sender<RepoPath>,
work_item: WorkItem, directory_to_visit: DirectoryToVisit,
progress: Option<&SnapshotProgress>, progress: Option<&SnapshotProgress>,
) -> Result<(), SnapshotError> { ) -> Result<(), SnapshotError> {
let WorkItem { let DirectoryToVisit {
dir, dir,
disk_dir, disk_dir,
git_ignore, git_ignore,
} = work_item; } = directory_to_visit;
if matcher.visit(&dir).is_nothing() { if matcher.visit(&dir).is_nothing() {
return Ok(()); return Ok(());
@ -796,7 +796,7 @@ impl TreeState {
} }
} }
} else { } else {
let work_item = WorkItem { let directory_to_visit = DirectoryToVisit {
dir: path, dir: path,
disk_dir: entry.path(), disk_dir: entry.path(),
git_ignore: git_ignore.clone(), git_ignore: git_ignore.clone(),
@ -807,7 +807,7 @@ impl TreeState {
tree_entries_tx.clone(), tree_entries_tx.clone(),
file_states_tx.clone(), file_states_tx.clone(),
deleted_files_tx.clone(), deleted_files_tx.clone(),
work_item, directory_to_visit,
progress, progress,
)?; )?;
} }