about summary refs log tree commit diff
path: root/src/bootstrap/channel.rs
diff options
context:
space:
mode:
authorAlex Crichton <alex@alexcrichton.com>2017-03-11 18:46:31 -0800
committerAlex Crichton <alex@alexcrichton.com>2017-03-12 10:18:16 -0700
commitb5798a9be80a239b54b69a6a750a8aeeaadbf1fc (patch)
treebf3b73ac091f0e902b4fb8cdf1dee22495d5e755 /src/bootstrap/channel.rs
parentf88b24b34c6d17ebe4014bec5a0f7c2a57c529c7 (diff)
downloadrust-b5798a9be80a239b54b69a6a750a8aeeaadbf1fc.tar.gz
rust-b5798a9be80a239b54b69a6a750a8aeeaadbf1fc.zip
Update Cargo to fix nightly channel
This commit updates Cargo with rust-lang/cargo#3820 which includes a fix for
rust-lang/cargo#3819. At the same time this also slightly tweaks how rustbuild
builds cargo to ensure that all the build information (including git info and
such) makes its way into the binary.

Closes rust-lang/cargo#3820
Diffstat (limited to 'src/bootstrap/channel.rs')
-rw-r--r--src/bootstrap/channel.rs15
1 files changed, 14 insertions, 1 deletions
diff --git a/src/bootstrap/channel.rs b/src/bootstrap/channel.rs
index c126c076a3d..2607ce412f1 100644
--- a/src/bootstrap/channel.rs
+++ b/src/bootstrap/channel.rs
@@ -42,9 +42,22 @@ struct Info {
 
 impl GitInfo {
     pub fn new(dir: &Path) -> GitInfo {
-        if !dir.join(".git").is_dir() {
+        // See if this even begins to look like a git dir
+        if !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 }
+        }
+
+        // Ok, let's scrape some info
         let ver_date = output(Command::new("git").current_dir(dir)
                                       .arg("log").arg("-1")
                                       .arg("--date=short")