Skip to content

Commit 502b630

Browse files
committed
tidy: don't crush on non-existent submodules
1 parent 2da29db commit 502b630

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/tools/tidy/src/deps.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -682,8 +682,10 @@ pub static CRATES: &[&str] = &[
682682
pub fn has_missing_submodule(root: &Path, submodules: &[&str]) -> bool {
683683
!CiEnv::is_ci()
684684
&& submodules.iter().any(|submodule| {
685+
let path = root.join(submodule);
686+
!path.exists()
685687
// If the directory is empty, we can consider it as an uninitialized submodule.
686-
read_dir(root.join(submodule)).unwrap().next().is_none()
688+
|| read_dir(path).unwrap().next().is_none()
687689
})
688690
}
689691

0 commit comments

Comments
 (0)