Skip to content

Commit 204bb9b

Browse files
borsehuss
authored andcommitted
Auto merge of #5314 - ehuss:remove-git2, r=flip1995
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
1 parent 329923e commit 204bb9b

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

Cargo.toml

+1-2
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@ clippy_lints = { version = "0.0.212", path = "clippy_lints" }
3737
regex = "1"
3838
semver = "0.9"
3939
rustc_tools_util = { version = "0.2.0", path = "rustc_tools_util"}
40-
git2 = { version = "0.12", optional = true }
4140
tempfile = { version = "3.1.0", optional = true }
4241
lazy_static = "1.0"
4342

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

6160
[features]
6261
deny-warnings = []
63-
integration = ["git2", "tempfile"]
62+
integration = ["tempfile"]

tests/integration.rs

+5-3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
#![cfg(feature = "integration")]
22

3-
use git2::Repository;
4-
53
use std::env;
64
use std::process::Command;
75

@@ -19,7 +17,11 @@ fn integration_test() {
1917
.path()
2018
.join(crate_name);
2119

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

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

0 commit comments

Comments
 (0)