Skip to content

Commit 14a646e

Browse files
committed
Add submodule to _corrupted_checkout tests
1 parent 827deaf commit 14a646e

File tree

1 file changed

+12
-3
lines changed

1 file changed

+12
-3
lines changed

tests/testsuite/git.rs

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ use std::sync::atomic::{AtomicBool, Ordering};
99
use std::sync::Arc;
1010
use std::thread;
1111

12-
use cargo_test_support::git::cargo_uses_gitoxide;
12+
use cargo_test_support::git::{add_submodule, cargo_uses_gitoxide};
1313
use cargo_test_support::paths;
1414
use cargo_test_support::prelude::IntoData;
1515
use cargo_test_support::prelude::*;
@@ -3847,11 +3847,20 @@ fn corrupted_checkout_with_cli() {
38473847
}
38483848

38493849
fn _corrupted_checkout(with_cli: bool) {
3850-
let git_project = git::new("dep1", |project| {
3850+
let (git_project, repository) = git::new_repo("dep1", |project| {
38513851
project
38523852
.file("Cargo.toml", &basic_manifest("dep1", "0.5.0"))
38533853
.file("src/lib.rs", "")
38543854
});
3855+
3856+
let project2 = git::new("dep2", |project| {
3857+
project.no_manifest().file("README.md", "")
3858+
});
3859+
let url = project2.root().to_url().to_string();
3860+
add_submodule(&repository, &url, Path::new("bar"));
3861+
git::commit(&repository);
3862+
drop(repository);
3863+
38553864
let p = project()
38563865
.file(
38573866
"Cargo.toml",
@@ -3962,7 +3971,7 @@ fn different_user_relative_submodules() {
39623971
&format!(
39633972
r#"
39643973
[package]
3965-
name = "foo"
3974+
name = "foo"
39663975
version = "0.5.0"
39673976
edition = "2015"
39683977

0 commit comments

Comments
 (0)