diff options
| author | DanConwayDev <DanConwayDev@protonmail.com> | 2023-10-01 00:00:00 +0100 |
|---|---|---|
| committer | DanConwayDev <DanConwayDev@protonmail.com> | 2023-10-01 00:00:00 +0100 |
| commit | 000901c0cbca8464b5a89bcc93c5474f6564bafd (patch) | |
| tree | 0ae11836c173ec6246e8b1eab7dc1e265e125426 /src/git.rs | |
| parent | b9a88672b8734448615354e3f46748d2fdc2f647 (diff) | |
feat(prs-create) send to multiple relays
add tests but these currently don't work when run together
Diffstat (limited to 'src/git.rs')
| -rw-r--r-- | src/git.rs | 17 |
1 files changed, 17 insertions, 0 deletions
| @@ -245,6 +245,23 @@ mod tests { | |||
| 245 | 245 | ||
| 246 | use super::*; | 246 | use super::*; |
| 247 | 247 | ||
| 248 | #[test] | ||
| 249 | fn get_commit_parent() -> Result<()> { | ||
| 250 | let test_repo = GitTestRepo::default(); | ||
| 251 | let parent_oid = test_repo.populate()?; | ||
| 252 | std::fs::write(test_repo.dir.join("t100.md"), "some content")?; | ||
| 253 | let child_oid = test_repo.stage_and_commit("add t100.md")?; | ||
| 254 | |||
| 255 | let git_repo = Repo::from_path(&test_repo.dir)?; | ||
| 256 | |||
| 257 | assert_eq!( | ||
| 258 | // Sha1Hash::from_byte_array("bla".to_string().as_bytes()), | ||
| 259 | oid_to_sha1(&parent_oid), | ||
| 260 | git_repo.get_commit_parent(&oid_to_sha1(&child_oid))?, | ||
| 261 | ); | ||
| 262 | Ok(()) | ||
| 263 | } | ||
| 264 | |||
| 248 | mod make_patch_from_commit { | 265 | mod make_patch_from_commit { |
| 249 | use super::*; | 266 | use super::*; |
| 250 | #[test] | 267 | #[test] |