@@ -96,9 +96,25 @@ mod os_impl {
9696
9797 #[ cfg( unix) ]
9898 pub fn check ( path : & Path , bad : & mut bool ) {
99+ const ALLOWED : & [ & str ] = & [ "configure" ] ;
100+
99101 crate :: walk_no_read (
100102 path,
101- & mut |path| crate :: filter_dirs ( path) || path. ends_with ( "src/etc" ) ,
103+ & mut |path| {
104+ crate :: filter_dirs ( path)
105+ || path. ends_with ( "src/etc" )
106+ // This is a list of directories that we almost certainly
107+ // don't need to walk. A future PR will likely want to
108+ // remove these in favor of crate::walk_no_read using git
109+ // ls-files to discover the paths we should check, which
110+ // would naturally ignore all of these directories. It's
111+ // also likely faster than walking the directory tree
112+ // directly (since git is just reading from a couple files
113+ // to produce the results).
114+ || path. ends_with ( "target" )
115+ || path. ends_with ( "build" )
116+ || path. ends_with ( ".git" )
117+ } ,
102118 & mut |entry| {
103119 let file = entry. path ( ) ;
104120 let filename = file. file_name ( ) . unwrap ( ) . to_string_lossy ( ) ;
@@ -110,6 +126,11 @@ mod os_impl {
110126 if t ! ( is_executable( & file) , file) {
111127 let rel_path = file. strip_prefix ( path) . unwrap ( ) ;
112128 let git_friendly_path = rel_path. to_str ( ) . unwrap ( ) . replace ( "\\ " , "/" ) ;
129+
130+ if ALLOWED . contains ( & git_friendly_path. as_str ( ) ) {
131+ return ;
132+ }
133+
113134 let output = Command :: new ( "git" )
114135 . arg ( "ls-files" )
115136 . arg ( & git_friendly_path)
0 commit comments