diff options
| author | Josh Stone <jistone@redhat.com> | 2017-04-03 13:46:50 -0700 |
|---|---|---|
| committer | Josh Stone <jistone@redhat.com> | 2017-04-03 13:46:50 -0700 |
| commit | 3fb1a849ddd162444e2894bce52f7bb2dbc53d69 (patch) | |
| tree | a291d51096541ca9125ab718211a71ea310db4ad /src/bootstrap/lib.rs | |
| parent | 5309a3e31d88def1f3ea966162ed4f81f161d500 (diff) | |
| download | rust-3fb1a849ddd162444e2894bce52f7bb2dbc53d69.tar.gz rust-3fb1a849ddd162444e2894bce52f7bb2dbc53d69.zip | |
Add a common Build::src_is_git flag
Diffstat (limited to 'src/bootstrap/lib.rs')
| -rw-r--r-- | src/bootstrap/lib.rs | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/bootstrap/lib.rs b/src/bootstrap/lib.rs index 84254d7d6ae..f80ba017f07 100644 --- a/src/bootstrap/lib.rs +++ b/src/bootstrap/lib.rs @@ -162,6 +162,7 @@ pub struct Build { cxx: HashMap<String, gcc::Tool>, crates: HashMap<String, Crate>, is_sudo: bool, + src_is_git: bool, } #[derive(Debug)] @@ -233,6 +234,7 @@ impl Build { }; let rust_info = channel::GitInfo::new(&src); let cargo_info = channel::GitInfo::new(&src.join("cargo")); + let src_is_git = src.join(".git").is_dir(); Build { flags: flags, @@ -251,6 +253,7 @@ impl Build { lldb_version: None, lldb_python_dir: None, is_sudo: is_sudo, + src_is_git: src_is_git, } } @@ -307,10 +310,7 @@ impl Build { OutOfSync, } - if !self.config.submodules { - return - } - if fs::metadata(self.src.join(".git")).is_err() { + if !self.src_is_git || !self.config.submodules { return } let git = || { |
