Skip to content

Commit

Permalink
Add submodule to _corrupted_checkout tests
Browse files Browse the repository at this point in the history
  • Loading branch information
osiewicz committed Oct 1, 2024
1 parent 827deaf commit 14a646e
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions tests/testsuite/git.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ use std::sync::atomic::{AtomicBool, Ordering};
use std::sync::Arc;
use std::thread;

use cargo_test_support::git::cargo_uses_gitoxide;
use cargo_test_support::git::{add_submodule, cargo_uses_gitoxide};
use cargo_test_support::paths;
use cargo_test_support::prelude::IntoData;
use cargo_test_support::prelude::*;
Expand Down Expand Up @@ -3847,11 +3847,20 @@ fn corrupted_checkout_with_cli() {
}

fn _corrupted_checkout(with_cli: bool) {
let git_project = git::new("dep1", |project| {
let (git_project, repository) = git::new_repo("dep1", |project| {
project
.file("Cargo.toml", &basic_manifest("dep1", "0.5.0"))
.file("src/lib.rs", "")
});

let project2 = git::new("dep2", |project| {
project.no_manifest().file("README.md", "")
});
let url = project2.root().to_url().to_string();
add_submodule(&repository, &url, Path::new("bar"));
git::commit(&repository);
drop(repository);

let p = project()
.file(
"Cargo.toml",
Expand Down Expand Up @@ -3962,7 +3971,7 @@ fn different_user_relative_submodules() {
&format!(
r#"
[package]
name = "foo"
name = "foo"
version = "0.5.0"
edition = "2015"
Expand Down

0 comments on commit 14a646e

Please sign in to comment.