mirror of
https://github.com/martinvonz/jj.git
synced 2024-12-27 06:27:43 +00:00
working_copy: rename sub_path
to path
The `sub_path` is created by joining `dir` to a basename. I think calling it just `path` is clear, especially since its the main path involved in each iteration of the loop.
This commit is contained in:
parent
02f2325fae
commit
bcba1c6682
1 changed files with 13 additions and 13 deletions
|
@ -672,8 +672,8 @@ impl TreeState {
|
|||
if name == ".jj" || name == ".git" {
|
||||
continue;
|
||||
}
|
||||
let sub_path = dir.join(&RepoPathComponent::from(name));
|
||||
if let Some(file_state) = self.file_states.get(&sub_path) {
|
||||
let path = dir.join(&RepoPathComponent::from(name));
|
||||
if let Some(file_state) = self.file_states.get(&path) {
|
||||
if file_state.file_type == FileType::GitSubmodule {
|
||||
continue;
|
||||
}
|
||||
|
@ -682,24 +682,24 @@ impl TreeState {
|
|||
if file_type.is_dir() {
|
||||
// If the whole directory is ignored, skip it unless we're already tracking
|
||||
// some file in it.
|
||||
if git_ignore.matches_all_files_in(&sub_path.to_internal_dir_string())
|
||||
&& current_tree.path_value(&sub_path).is_none()
|
||||
if git_ignore.matches_all_files_in(&path.to_internal_dir_string())
|
||||
&& current_tree.path_value(&path).is_none()
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
work.push(WorkItem {
|
||||
dir: sub_path,
|
||||
dir: path,
|
||||
disk_dir: entry.path(),
|
||||
git_ignore: git_ignore.clone(),
|
||||
});
|
||||
} else if matcher.matches(&sub_path) {
|
||||
} else if matcher.matches(&path) {
|
||||
if let Some(progress) = progress {
|
||||
progress(&sub_path);
|
||||
progress(&path);
|
||||
}
|
||||
let maybe_current_file_state = self.file_states.get(&sub_path);
|
||||
let maybe_current_file_state = self.file_states.get(&path);
|
||||
if maybe_current_file_state.is_none()
|
||||
&& git_ignore.matches_file(&sub_path.to_internal_file_string())
|
||||
&& git_ignore.matches_file(&path.to_internal_file_string())
|
||||
{
|
||||
// If it wasn't already tracked and it matches
|
||||
// the ignored paths, then
|
||||
|
@ -714,18 +714,18 @@ impl TreeState {
|
|||
err,
|
||||
})?;
|
||||
if let Some(new_file_state) = file_state(&metadata) {
|
||||
deleted_files.remove(&sub_path);
|
||||
deleted_files.remove(&path);
|
||||
let update = self.get_updated_tree_value(
|
||||
&sub_path,
|
||||
&path,
|
||||
entry.path(),
|
||||
maybe_current_file_state,
|
||||
¤t_tree,
|
||||
&new_file_state,
|
||||
)?;
|
||||
if let Some(tree_value) = update {
|
||||
tree_builder.set(sub_path.clone(), tree_value);
|
||||
tree_builder.set(path.clone(), tree_value);
|
||||
}
|
||||
self.file_states.insert(sub_path, new_file_state);
|
||||
self.file_states.insert(path, new_file_state);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue