From 2cdbb8c7ac6c98af6e36c4458c08bef2299794e1 Mon Sep 17 00:00:00 2001 From: DanConwayDev Date: Mon, 23 Sep 2024 10:46:26 +0100 Subject: fix(remote): add resilience to `prs` make poorly formatted patches fail silently. we stop trusting that the `commit` tag in the latest patch can be produced by apply the patches. to achieve this we must recreate the commit during the list command, which require fetching the parent oids. support patches without optional `commit` and `parent-commit` tags. --- tests/git_remote_nostr/list.rs | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'tests/git_remote_nostr/list.rs') diff --git a/tests/git_remote_nostr/list.rs b/tests/git_remote_nostr/list.rs index d173cc7..37cff30 100644 --- a/tests/git_remote_nostr/list.rs +++ b/tests/git_remote_nostr/list.rs @@ -52,6 +52,10 @@ mod without_state_announcement { assert_eq!( res.split("\r\n") .map(|e| e.to_string()) + .filter(|s| !s.contains("remote: ") + && !s.contains("Receiving objects") + && !s.contains("Resolving deltas") + && !s.contains("fetching /")) .collect::>(), HashSet::from([ "@refs/heads/main HEAD".to_string(), @@ -220,6 +224,10 @@ mod with_state_announcement { assert_eq!( res.split("\r\n") .map(|e| e.to_string()) + .filter(|s| !s.contains("remote: ") + && !s.contains("Receiving objects") + && !s.contains("Resolving deltas") + && !s.contains("fetching /")) .collect::>(), HashSet::from([ "@refs/heads/main HEAD".to_string(), -- cgit v1.2.3