From 9835e2ae736235810b4ea1c162ca5e65c547e770 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sat, 18 May 2024 04:49:50 +0200 Subject: Merging upstream version 1.71.1+dfsg1. Signed-off-by: Daniel Baumann --- src/tools/cargo/tests/testsuite/patch.rs | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) (limited to 'src/tools/cargo/tests/testsuite/patch.rs') diff --git a/src/tools/cargo/tests/testsuite/patch.rs b/src/tools/cargo/tests/testsuite/patch.rs index 681c02416..f2f077d7d 100644 --- a/src/tools/cargo/tests/testsuite/patch.rs +++ b/src/tools/cargo/tests/testsuite/patch.rs @@ -2466,7 +2466,11 @@ fn can_update_with_alt_reg() { } #[cargo_test] -fn old_git_patch() { +fn gitoxide_clones_shallow_old_git_patch() { + perform_old_git_patch(true) +} + +fn perform_old_git_patch(shallow: bool) { // Example where an old lockfile with an explicit branch="master" in Cargo.toml. Package::new("bar", "1.0.0").publish(); let (bar, bar_repo) = git::new_repo("bar", |p| { @@ -2524,7 +2528,13 @@ dependencies = [ git::commit(&bar_repo); // This *should* keep the old lock. - p.cargo("tree") + let mut cargo = p.cargo("tree"); + if shallow { + cargo + .arg("-Zgitoxide=fetch,shallow-deps") + .masquerade_as_nightly_cargo(&["unstable features must be available for -Z gitoxide"]); + } + cargo // .env("CARGO_LOG", "trace") .with_stderr( "\ @@ -2542,6 +2552,11 @@ foo v0.1.0 [..] .run(); } +#[cargo_test] +fn old_git_patch() { + perform_old_git_patch(false) +} + // From https://github.com/rust-lang/cargo/issues/7463 #[cargo_test] fn patch_eq_conflict_panic() { -- cgit v1.2.3