File tree Expand file tree Collapse file tree 2 files changed +5
-5
lines changed Expand file tree Collapse file tree 2 files changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -162,6 +162,7 @@ pub struct Build {
162
162
cxx : HashMap < String , gcc:: Tool > ,
163
163
crates : HashMap < String , Crate > ,
164
164
is_sudo : bool ,
165
+ src_is_git : bool ,
165
166
}
166
167
167
168
#[ derive( Debug ) ]
@@ -233,6 +234,7 @@ impl Build {
233
234
} ;
234
235
let rust_info = channel:: GitInfo :: new ( & src) ;
235
236
let cargo_info = channel:: GitInfo :: new ( & src. join ( "cargo" ) ) ;
237
+ let src_is_git = src. join ( ".git" ) . is_dir ( ) ;
236
238
237
239
Build {
238
240
flags : flags,
@@ -251,6 +253,7 @@ impl Build {
251
253
lldb_version : None ,
252
254
lldb_python_dir : None ,
253
255
is_sudo : is_sudo,
256
+ src_is_git : src_is_git,
254
257
}
255
258
}
256
259
@@ -307,10 +310,7 @@ impl Build {
307
310
OutOfSync ,
308
311
}
309
312
310
- if !self . config . submodules {
311
- return
312
- }
313
- if fs:: metadata ( self . src . join ( ".git" ) ) . is_err ( ) {
313
+ if !self . src_is_git || !self . config . submodules {
314
314
return
315
315
}
316
316
let git = || {
Original file line number Diff line number Diff line change @@ -65,7 +65,7 @@ pub fn check(build: &mut Build) {
65
65
66
66
// If we've got a git directory we're gona need git to update
67
67
// submodules and learn about various other aspects.
68
- if fs :: metadata ( build. src . join ( ".git" ) ) . is_ok ( ) {
68
+ if build. src_is_git {
69
69
need_cmd ( "git" . as_ref ( ) ) ;
70
70
}
71
71
You can’t perform that action at this time.
0 commit comments