Skip to content

Commit 36c12f0

Browse files
committed
reproduce #5099, adding a submodule as project fails
1 parent 304f92b commit 36c12f0

File tree

3 files changed

+32
-0
lines changed

3 files changed

+32
-0
lines changed
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
#!/usr/bin/env bash
2+
set -eu -o pipefail
3+
4+
git init simple
5+
(cd simple
6+
>file && git add file && git commit -m "init"
7+
)
8+
9+
git clone simple submodule
10+
11+
git clone simple with-submodule
12+
(cd with-submodule
13+
git submodule add ../submodule
14+
git commit -m "add submodule"
15+
)

crates/gitbutler-project/tests/projects/main.rs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,18 @@ mod add {
2424
mod error {
2525
use super::*;
2626

27+
#[test]
28+
fn submodule() {
29+
let (controller, _tmp) = new();
30+
let root = gitbutler_testsupport::gix_testtools::scripted_fixture_read_only(
31+
"various-repositories.sh",
32+
)
33+
.unwrap()
34+
.join("with-submodule");
35+
let err = controller.add(root).unwrap_err();
36+
assert_eq!(err.to_string(), "TBD");
37+
}
38+
2739
#[test]
2840
fn missing() {
2941
let (controller, _tmp) = new();

crates/gitbutler-testsupport/src/lib.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
#![forbid(rust_2018_idioms)]
22
pub const VAR_NO_CLEANUP: &str = "GITBUTLER_TESTS_NO_CLEANUP";
33

4+
/// Direct access to lower-level utilities for cases where this is enough.
5+
///
6+
/// Prefer to use [`read_only`] and [`writable`] otherwise.
7+
pub use gix_testtools;
8+
49
mod test_project;
510
pub use test_project::TestProject;
611

0 commit comments

Comments
 (0)