]> git.lizzy.rs Git - rust.git/blobdiff - src/bootstrap/channel.rs
bump nightly to 1.37.0
[rust.git] / src / bootstrap / channel.rs
index aa683161b6547fe5a47f102c9b6eb1078998bda4..41235d911c03e52131bc1f6be897140c4c73f152 100644 (file)
 use build_helper::output;
 
 use crate::Build;
-use crate::config::Config;
 
 // The version number
-pub const CFG_RELEASE_NUM: &str = "1.35.0";
+pub const CFG_RELEASE_NUM: &str = "1.37.0";
 
 pub struct GitInfo {
     inner: Option<Info>,
@@ -27,20 +26,20 @@ struct Info {
 }
 
 impl GitInfo {
-    pub fn new(config: &Config, dir: &Path) -> GitInfo {
+    pub fn new(ignore_git: bool, dir: &Path) -> GitInfo {
         // See if this even begins to look like a git dir
-        if config.ignore_git || !dir.join(".git").exists() {
+        if ignore_git || !dir.join(".git").exists() {
             return GitInfo { inner: None }
         }
 
         // Make sure git commands work
-        let out = Command::new("git")
-                          .arg("rev-parse")
-                          .current_dir(dir)
-                          .output()
-                          .expect("failed to spawn git");
-        if !out.status.success() {
-            return GitInfo { inner: None }
+        match Command::new("git")
+            .arg("rev-parse")
+            .current_dir(dir)
+            .output()
+        {
+            Ok(ref out) if out.status.success() => {}
+            _ => return GitInfo { inner: None },
         }
 
         // Ok, let's scrape some info