equal
deleted
inserted
replaced
711 /// list instead. |
711 /// list instead. |
712 fn read_dir(path: &Path, is_at_repo_root: bool) -> io::Result<Vec<Self>> { |
712 fn read_dir(path: &Path, is_at_repo_root: bool) -> io::Result<Vec<Self>> { |
713 let mut results = Vec::new(); |
713 let mut results = Vec::new(); |
714 for entry in path.read_dir()? { |
714 for entry in path.read_dir()? { |
715 let entry = entry?; |
715 let entry = entry?; |
716 let metadata = entry.metadata()?; |
716 let metadata = match entry.metadata() { |
|
717 Ok(v) => v, |
|
718 Err(e) => { |
|
719 // race with file deletion? |
|
720 if e.kind() == std::io::ErrorKind::NotFound { |
|
721 continue; |
|
722 } else { |
|
723 return Err(e); |
|
724 } |
|
725 } |
|
726 }; |
717 let name = get_bytes_from_os_string(entry.file_name()); |
727 let name = get_bytes_from_os_string(entry.file_name()); |
718 // FIXME don't do this when cached |
728 // FIXME don't do this when cached |
719 if name == b".hg" { |
729 if name == b".hg" { |
720 if is_at_repo_root { |
730 if is_at_repo_root { |
721 // Skip the repo’s own .hg (might be a symlink) |
731 // Skip the repo’s own .hg (might be a symlink) |