@@ -96,9 +96,25 @@ mod os_impl {
96
96
97
97
#[ cfg( unix) ]
98
98
pub fn check ( path : & Path , bad : & mut bool ) {
99
+ const ALLOWED : & [ & str ] = & [ "configure" ] ;
100
+
99
101
crate :: walk_no_read (
100
102
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
+ } ,
102
118
& mut |entry| {
103
119
let file = entry. path ( ) ;
104
120
let filename = file. file_name ( ) . unwrap ( ) . to_string_lossy ( ) ;
@@ -110,6 +126,11 @@ mod os_impl {
110
126
if t ! ( is_executable( & file) , file) {
111
127
let rel_path = file. strip_prefix ( path) . unwrap ( ) ;
112
128
let git_friendly_path = rel_path. to_str ( ) . unwrap ( ) . replace ( "\\ " , "/" ) ;
129
+
130
+ if ALLOWED . contains ( & git_friendly_path. as_str ( ) ) {
131
+ return ;
132
+ }
133
+
113
134
let output = Command :: new ( "git" )
114
135
. arg ( "ls-files" )
115
136
. arg ( & git_friendly_path)
0 commit comments