From 24125936adb6c152cdb16d55f2639dd374dfee1d Mon Sep 17 00:00:00 2001 From: DanConwayDev Date: Thu, 1 Aug 2024 10:17:01 +0100 Subject: feat(remote): `push` to all `clone` servers initially we push to the first server, if successful update the state event, then siliently push to the others and silently fail --- test_utils/src/git.rs | 2 +- test_utils/src/lib.rs | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'test_utils/src') diff --git a/test_utils/src/git.rs b/test_utils/src/git.rs index 4a4aaa8..e522ffd 100644 --- a/test_utils/src/git.rs +++ b/test_utils/src/git.rs @@ -62,7 +62,7 @@ impl GitTestRepo { Self::new("main").unwrap() } - fn duplicate(existing_repo: &GitTestRepo) -> Result { + pub fn duplicate(existing_repo: &GitTestRepo) -> Result { let path = current_dir()?.join(format!("tmpgit-{}", rand::random::())); // function source: https://stackoverflow.com/a/65192210 fn copy_dir_all(src: impl AsRef, dst: impl AsRef) -> std::io::Result<()> { diff --git a/test_utils/src/lib.rs b/test_utils/src/lib.rs index 7a2bf35..2e7a4e8 100644 --- a/test_utils/src/lib.rs +++ b/test_utils/src/lib.rs @@ -150,10 +150,10 @@ pub fn make_event_old_or_change_user( } pub fn generate_repo_ref_event() -> nostr::Event { - generate_repo_ref_event_with_git_server("git:://123.gitexample.com/test") + generate_repo_ref_event_with_git_server(vec!["git:://123.gitexample.com/test".to_string()]) } -pub fn generate_repo_ref_event_with_git_server(git_server: &str) -> nostr::Event { +pub fn generate_repo_ref_event_with_git_server(git_servers: Vec) -> nostr::Event { // taken from test git_repo // TODO - this may not be consistant across computers as it might take the // author and committer from global git config @@ -171,7 +171,7 @@ pub fn generate_repo_ref_event_with_git_server(git_server: &str) -> nostr::Event Tag::from_standardized(TagStandard::Description("example description".into())), Tag::custom( nostr::TagKind::Custom(std::borrow::Cow::Borrowed("clone")), - vec![git_server.to_string()], + git_servers, ), Tag::custom( nostr::TagKind::Custom(std::borrow::Cow::Borrowed("web")), -- cgit v1.2.3