Skip to content

Commit

Permalink
Auto merge of rust-lang#5314 - ehuss:remove-git2, r=flip1995
Browse files Browse the repository at this point in the history
Remove git2 dependency.

This removes the `git2` dependency (used in the integration test).  Updating git2 is awkward because both cargo and clippy have to be updated in sync, so this removes that requirement. It didn't look like it was using the git2 library for any particular reason, so this just launches the `git` executable, which should be available more or less everywhere.

This unblocks updating Cargo.

changelog: none
  • Loading branch information
bors committed Mar 14, 2020
2 parents 2d8a362 + 626f2fe commit ceb9b7d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
3 changes: 1 addition & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ clippy_lints = { version = "0.0.212", path = "clippy_lints" }
regex = "1"
semver = "0.9"
rustc_tools_util = { version = "0.2.0", path = "rustc_tools_util"}
git2 = { version = "0.12", optional = true }
tempfile = { version = "3.1.0", optional = true }
lazy_static = "1.0"

Expand All @@ -60,4 +59,4 @@ rustc_tools_util = { version = "0.2.0", path = "rustc_tools_util"}

[features]
deny-warnings = []
integration = ["git2", "tempfile"]
integration = ["tempfile"]
8 changes: 5 additions & 3 deletions tests/integration.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
#![cfg(feature = "integration")]

use git2::Repository;

use std::env;
use std::process::Command;

Expand All @@ -19,7 +17,11 @@ fn integration_test() {
.path()
.join(crate_name);

Repository::clone(&repo_url, &repo_dir).expect("clone of repo failed");
let st = Command::new("git")
.args(&["clone", "--depth=1", &repo_url, repo_dir.to_str().unwrap()])
.status()
.expect("unable to run git");
assert!(st.success());

let root_dir = std::path::PathBuf::from(env!("CARGO_MANIFEST_DIR"));
let target_dir = std::path::Path::new(&root_dir).join("target");
Expand Down

0 comments on commit ceb9b7d

Please sign in to comment.