X-Git-Url: https://git.lizzy.rs/?a=blobdiff_plain;f=src%2Fbootstrap%2Fchannel.rs;h=41235d911c03e52131bc1f6be897140c4c73f152;hb=924cdd4532e4b0124f38584a7b886ba0f8516782;hp=aa683161b6547fe5a47f102c9b6eb1078998bda4;hpb=0c4cb48e03af0cc7481b76ada343c092bf6dfdfd;p=rust.git diff --git a/src/bootstrap/channel.rs b/src/bootstrap/channel.rs index aa683161b65..41235d911c0 100644 --- a/src/bootstrap/channel.rs +++ b/src/bootstrap/channel.rs @@ -11,10 +11,9 @@ 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, @@ -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