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 | |
| parent | 5309a3e31d88def1f3ea966162ed4f81f161d500 (diff) | |
| download | rust-3fb1a849ddd162444e2894bce52f7bb2dbc53d69.tar.gz rust-3fb1a849ddd162444e2894bce52f7bb2dbc53d69.zip | |
Add a common Build::src_is_git flag
| -rw-r--r-- | src/bootstrap/lib.rs | 8 | ||||
| -rw-r--r-- | src/bootstrap/sanity.rs | 2 |
2 files changed, 5 insertions, 5 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 = || { diff --git a/src/bootstrap/sanity.rs b/src/bootstrap/sanity.rs index 235ce9360ef..d1b235f4691 100644 --- a/src/bootstrap/sanity.rs +++ b/src/bootstrap/sanity.rs @@ -65,7 +65,7 @@ pub fn check(build: &mut Build) { // If we've got a git directory we're gona need git to update // submodules and learn about various other aspects. - if fs::metadata(build.src.join(".git")).is_ok() { + if build.src_is_git { need_cmd("git".as_ref()); } |
