File tree 1 file changed +9
-6
lines changed
1 file changed +9
-6
lines changed Original file line number Diff line number Diff line change @@ -202,11 +202,12 @@ impl Ignore {
202
202
errs. maybe_push ( err) ;
203
203
igtmp. is_absolute_parent = true ;
204
204
igtmp. absolute_base = Some ( absolute_base. clone ( ) ) ;
205
- igtmp. has_git = if self . 0 . opts . git_ignore {
206
- parent. join ( ".git" ) . exists ( )
207
- } else {
208
- false
209
- } ;
205
+ igtmp. has_git =
206
+ if self . 0 . opts . require_git && self . 0 . opts . git_ignore {
207
+ parent. join ( ".git" ) . exists ( )
208
+ } else {
209
+ false
210
+ } ;
210
211
ig = Ignore ( Arc :: new ( igtmp) ) ;
211
212
compiled. insert ( parent. as_os_str ( ) . to_os_string ( ) , ig. clone ( ) ) ;
212
213
}
@@ -231,7 +232,9 @@ impl Ignore {
231
232
232
233
/// Like add_child, but takes a full path and returns an IgnoreInner.
233
234
fn add_child_path ( & self , dir : & Path ) -> ( IgnoreInner , Option < Error > ) {
234
- let git_type = if self . 0 . opts . git_ignore || self . 0 . opts . git_exclude {
235
+ let git_type = if self . 0 . opts . require_git
236
+ && ( self . 0 . opts . git_ignore || self . 0 . opts . git_exclude )
237
+ {
235
238
dir. join ( ".git" ) . metadata ( ) . ok ( ) . map ( |md| md. file_type ( ) )
236
239
} else {
237
240
None
You can’t perform that action at this time.
0 commit comments