comparison rust/hg-core/src/dirstate_tree/status.rs @ 48794:834c938227c6

branching: merge stable into default
author Rapha?l Gom?s <rgomes@octobus.net>
date Fri, 18 Feb 2022 11:37:08 +0100
parents 94e36b230990 dcec16e799dd
children e2f8ed37201c
comparison
equal deleted inserted replaced
48793:6e559391f96e 48794:834c938227c6
776 let at_cwd = path == Path::new(""); 776 let at_cwd = path == Path::new("");
777 let read_dir_path = if at_cwd { Path::new(".") } else { path }; 777 let read_dir_path = if at_cwd { Path::new(".") } else { path };
778 let mut results = Vec::new(); 778 let mut results = Vec::new();
779 for entry in read_dir_path.read_dir()? { 779 for entry in read_dir_path.read_dir()? {
780 let entry = entry?; 780 let entry = entry?;
781 let metadata = entry.metadata()?; 781 let metadata = match entry.metadata() {
782 Ok(v) => v,
783 Err(e) => {
784 // race with file deletion?
785 if e.kind() == std::io::ErrorKind::NotFound {
786 continue;
787 } else {
788 return Err(e);
789 }
790 }
791 };
782 let file_name = entry.file_name(); 792 let file_name = entry.file_name();
783 // FIXME don't do this when cached 793 // FIXME don't do this when cached
784 if file_name == ".hg" { 794 if file_name == ".hg" {
785 if is_at_repo_root { 795 if is_at_repo_root {
786 // Skip the repo’s own .hg (might be a symlink) 796 // Skip the repo’s own .hg (might be a symlink)