equal
deleted
inserted
replaced
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) |