Skip to content

Commit d0f3a62

Browse files
committed
test: succeed to remove and add a submodule back
2024-11-03T04:24:30.492345Z INFO docs::repo: old_submodules=0 new_submodules=2 Cloning into '/rust/my/docs/repos/os-checker/plugin-cargo'... remote: Enumerating objects: 182, done. remote: Counting objects: 100% (182/182), done. remote: Compressing objects: 100% (92/92), done. remote: Total 182 (delta 89), reused 166 (delta 73), pack-reused 0 (from 0) Receiving objects: 100% (182/182), 27.86 KiB | 1.99 MiB/s, done. Resolving deltas: 100% (89/89), done. [main 2bfb4ae] submodule: add os-checker/plugin-cargo 2 files changed, 4 insertions(+) create mode 160000 repos/os-checker/plugin-cargo 2024-11-03T04:24:35.448207Z INFO docs::repo: old_submodules=2 new_submodules=3 2024-11-03T04:24:35.450855Z INFO docs::manage: append a new user_repo key="os-checker/plugin-cargo" test manage::update_a_user_repo ... ok
1 parent 2bfb4ae commit d0f3a62

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

src/manage.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ impl Manage {
4747
}
4848

4949
#[test]
50+
// #[ignore = "should be comfirmed to call this"]
5051
fn update_a_user_repo() -> Result<()> {
5152
plugin_cargo::logger::init();
5253
let mut manage = Manage::new()?;

src/submodule_add.rs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
use crate::{manage::Local, REPOS};
22
use duct::cmd;
3-
use indexmap::IndexSet;
43
use plugin_cargo::prelude::*;
54

65
fn git_link(user: &str, repo: &str) -> String {
@@ -44,6 +43,9 @@ fn submodule_remove(path: &Utf8Path) -> Result<()> {
4443

4544
cmd!("rm", "-rf", path).run()?;
4645

46+
let msg = format!("submodule: remove {path}");
47+
cmd!("git", "commit", "-m", msg).run()?;
48+
4749
Ok(())
4850
}
4951

@@ -56,7 +58,6 @@ fn add() -> Result<()> {
5658
#[test]
5759
#[ignore = "should be confirmed to call this"]
5860
fn remove() -> Result<()> {
59-
submodule_remove("repos/os-checker".into())?;
60-
submodule_remove("repos/os-checker-test-suite".into())?;
61+
submodule_remove("repos/os-checker/plugin-cargo".into())?;
6162
Ok(())
6263
}

0 commit comments

Comments
 (0)