From cf319efc6dcdc6c54564cb84e13218edbf3643fa Mon Sep 17 00:00:00 2001 From: DanConwayDev Date: Tue, 13 Feb 2024 14:52:24 +0000 Subject: feat!: nip34 make pr event optional use first patch as thread root if pr event isn't present. begin renaming pr event to cover letter. fix patch ordering upon creation. patches were in youngest first order which caused: - `PATCH n/t`to be in reverse order - the youngest patch was the marked root - oldest patch replied to the youngest fix finding most recent patch event. when a patch in a set is the most recent it will share a created_at with other patches. previously the first patch recieved from relay in the set would be used. now it finds the first patch with that created_at which isn't also a parent of another patch with the same created_at. --- src/git.rs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'src/git.rs') diff --git a/src/git.rs b/src/git.rs index 24afe76..cd42724 100644 --- a/src/git.rs +++ b/src/git.rs @@ -1265,6 +1265,7 @@ mod tests { &RepoRef::try_from(generate_repo_ref_event()).unwrap(), None, None, + None, ) } fn test_patch_applies_to_repository(patch_event: nostr::Event) -> Result<()> { @@ -1418,9 +1419,7 @@ mod tests { let git_repo = Repo::from_path(&original_repo.dir)?; let mut events = generate_pr_and_patch_events( - // Some(("test".to_string(), "test".to_string())), - "title", - "description", + Some(("test".to_string(), "test".to_string())), &git_repo, &vec![oid_to_sha1(&oid1), oid_to_sha1(&oid2), oid_to_sha1(&oid3)], &TEST_KEY_1_KEYS, -- cgit v1.2.3