From 000901c0cbca8464b5a89bcc93c5474f6564bafd Mon Sep 17 00:00:00 2001 From: DanConwayDev Date: Sun, 1 Oct 2023 00:00:00 +0100 Subject: feat(prs-create) send to multiple relays add tests but these currently don't work when run together --- src/git.rs | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'src/git.rs') diff --git a/src/git.rs b/src/git.rs index ddbc646..337444a 100644 --- a/src/git.rs +++ b/src/git.rs @@ -245,6 +245,23 @@ mod tests { use super::*; + #[test] + fn get_commit_parent() -> Result<()> { + let test_repo = GitTestRepo::default(); + let parent_oid = test_repo.populate()?; + std::fs::write(test_repo.dir.join("t100.md"), "some content")?; + let child_oid = test_repo.stage_and_commit("add t100.md")?; + + let git_repo = Repo::from_path(&test_repo.dir)?; + + assert_eq!( + // Sha1Hash::from_byte_array("bla".to_string().as_bytes()), + oid_to_sha1(&parent_oid), + git_repo.get_commit_parent(&oid_to_sha1(&child_oid))?, + ); + Ok(()) + } + mod make_patch_from_commit { use super::*; #[test] -- cgit v1.2.3