Revert update of libgit2
authorAlex Crichton <alex@alexcrichton.com>
Mon, 17 Aug 2015 16:46:45 +0000 (09:46 -0700)
committerAlex Crichton <alex@alexcrichton.com>
Mon, 17 Aug 2015 17:08:13 +0000 (10:08 -0700)
Unfortunately this flew past on the bots because we didn't built on one of the
10.7 bots, but it looks like libgit2 doesn't currently build on OSX 10.7 so
we'll have to wait until that's fixed to update.

Cargo.lock
Cargo.toml
src/cargo/sources/git/utils.rs
tests/support/git.rs
tests/test_cargo_build_auth.rs
tests/test_cargo_compile_git_deps.rs

index f945f715dd483df288db96cc4cdf7548a6c3dcd0..ecfb4ccb97605195dfacfabbb3ff7940d11a3438 100644 (file)
@@ -10,13 +10,13 @@ dependencies = [
  "env_logger 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)",
  "filetime 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)",
  "flate2 0.2.7 (registry+https://github.com/rust-lang/crates.io-index)",
- "git2 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)",
- "git2-curl 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)",
+ "git2 0.2.14 (registry+https://github.com/rust-lang/crates.io-index)",
+ "git2-curl 0.2.4 (registry+https://github.com/rust-lang/crates.io-index)",
  "glob 0.2.10 (registry+https://github.com/rust-lang/crates.io-index)",
  "hamcrest 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
  "kernel32-sys 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)",
  "libc 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)",
- "libgit2-sys 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)",
+ "libgit2-sys 0.2.20 (registry+https://github.com/rust-lang/crates.io-index)",
  "log 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)",
  "num_cpus 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)",
  "regex 0.1.41 (registry+https://github.com/rust-lang/crates.io-index)",
@@ -148,22 +148,22 @@ dependencies = [
 
 [[package]]
 name = "git2"
-version = "0.3.0"
+version = "0.2.14"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 dependencies = [
  "bitflags 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
  "libc 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)",
- "libgit2-sys 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)",
+ "libgit2-sys 0.2.20 (registry+https://github.com/rust-lang/crates.io-index)",
  "url 0.2.37 (registry+https://github.com/rust-lang/crates.io-index)",
 ]
 
 [[package]]
 name = "git2-curl"
-version = "0.3.0"
+version = "0.2.4"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 dependencies = [
  "curl 0.2.10 (registry+https://github.com/rust-lang/crates.io-index)",
- "git2 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)",
+ "git2 0.2.14 (registry+https://github.com/rust-lang/crates.io-index)",
  "log 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)",
  "url 0.2.37 (registry+https://github.com/rust-lang/crates.io-index)",
 ]
@@ -197,10 +197,9 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
 
 [[package]]
 name = "libgit2-sys"
-version = "0.3.2"
+version = "0.2.20"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 dependencies = [
- "cmake 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)",
  "libc 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)",
  "libssh2-sys 0.1.29 (registry+https://github.com/rust-lang/crates.io-index)",
  "libz-sys 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)",
index 16aacb34711400fe16a32eabd19d35d4ec11d48a..5c360c81df913e3570541ddaf0b7e9c58bba704d 100644 (file)
@@ -23,12 +23,12 @@ docopt = "0.6"
 env_logger = "0.3"
 filetime = "0.1"
 flate2 = "0.2"
-git2 = "0.3"
-git2-curl = "0.3"
+git2 = "0.2"
+git2-curl = "0.2"
 glob = "0.2"
 kernel32-sys = "0.1"
 libc = "0.1"
-libgit2-sys = "0.3"
+libgit2-sys = "0.2"
 log = "0.3"
 num_cpus = "0.2"
 regex = "0.1"
index 492bf9533b5be917b60ee8d352ba15420ba3162d..51f69a6d27e893be49146dcba1421bee55a949f3 100644 (file)
@@ -413,11 +413,10 @@ pub fn fetch(repo: &git2::Repository, url: &str,
     with_authentication(url, &try!(repo.config()), |f| {
         let mut cb = git2::RemoteCallbacks::new();
         cb.credentials(f);
-        let mut remote = try!(repo.remote_anonymous(&url));
-        let mut opts = git2::FetchOptions::new();
-        opts.remote_callbacks(cb)
-            .download_tags(git2::AutotagOption::All);
-        try!(remote.fetch(&[refspec], Some(&mut opts), None));
+        let mut remote = try!(repo.remote_anonymous(&url, Some(refspec)));
+        try!(remote.add_fetch("refs/tags/*:refs/tags/*"));
+        remote.set_callbacks(cb);
+        try!(remote.fetch(&["refs/tags/*:refs/tags/*", refspec], None));
         Ok(())
     })
 }
index a84e5287dee527e1b76a0c631893b2275aecd97d..082f07fab6a072d738e50690971774c6c7171ed3 100644 (file)
@@ -97,9 +97,10 @@ pub fn add_submodule<'a>(repo: &'a git2::Repository, url: &str,
     let path = path.to_str().unwrap().replace(r"\", "/");
     let mut s = repo.submodule(url, Path::new(&path), false).unwrap();
     let subrepo = s.open().unwrap();
-    subrepo.remote_add_fetch("origin", "refs/heads/*:refs/heads/*").unwrap();
     let mut origin = subrepo.find_remote("origin").unwrap();
-    origin.fetch(&[], None, None).unwrap();
+    origin.add_fetch("refs/heads/*:refs/heads/*").unwrap();
+    origin.fetch(&[], None).unwrap();
+    origin.save().unwrap();
     subrepo.checkout_head(None).unwrap();
     s.add_finalize().unwrap();
     return s;
index 9dcf1293ce81dace079a26babc271149d9437907..0416c477cd80096e8a684bad1dcf91bc8dd70909 100644 (file)
@@ -40,7 +40,7 @@ test!(http_auth_offered {
         assert_eq!(req, vec![
             "GET /foo/bar/info/refs?service=git-upload-pack HTTP/1.1",
             "Accept: */*",
-            "User-Agent: git/1.0 (libgit2 0.23.0)",
+            "User-Agent: git/1.0 (libgit2 0.22.0)",
         ].into_iter().map(|s| s.to_string()).collect());
         drop(s);
 
@@ -55,7 +55,7 @@ test!(http_auth_offered {
             "GET /foo/bar/info/refs?service=git-upload-pack HTTP/1.1",
             "Authorization: Basic Zm9vOmJhcg==",
             "Accept: */*",
-            "User-Agent: git/1.0 (libgit2 0.23.0)",
+            "User-Agent: git/1.0 (libgit2 0.22.0)",
         ].into_iter().map(|s| s.to_string()).collect());
     });
 
@@ -155,8 +155,6 @@ Caused by:
         addr = addr,
         errmsg = if cfg!(windows) {
             "[[..]] failed to send request: [..]\n"
-        } else if cfg!(target_os = "macos") {
-            "[[..]] unexpected return value from ssl handshake [..]"
         } else {
             "[[..]] SSL error: [..]"
         })));
index 34d2e37f99f7f01e9900363c4621f5f217ede369..834b294bb512e0a404bb396bedfc20883c17d2f2 100644 (file)
@@ -921,12 +921,12 @@ test!(dep_with_changed_submodule {
     sub.sync().unwrap();
     {
         let subrepo = sub.open().unwrap();
-        subrepo.remote_add_fetch("origin",
-                                 "refs/heads/*:refs/heads/*").unwrap();
-        subrepo.remote_set_url("origin",
-                               &git_project3.url().to_string()).unwrap();
         let mut origin = subrepo.find_remote("origin").unwrap();
-        origin.fetch(&[], None, None).unwrap();
+        origin.set_url(&git_project3.url().to_string()).unwrap();
+        origin.add_fetch("refs/heads/*:refs/heads/*").unwrap();;
+        origin.fetch(&[], None).unwrap();
+        origin.save().unwrap();
+
         let id = subrepo.refname_to_id("refs/remotes/origin/master").unwrap();
         let obj = subrepo.find_object(id, None).unwrap();
         subrepo.reset(&obj, git2::ResetType::Hard, None).unwrap();