diff options
| author | DanConwayDev <DanConwayDev@protonmail.com> | 2026-01-08 00:50:54 +0000 |
|---|---|---|
| committer | DanConwayDev <DanConwayDev@protonmail.com> | 2026-01-08 00:50:54 +0000 |
| commit | f75e1c59aacf5ce668fd327e4e3d827511661c2a (patch) | |
| tree | 867926c7503e7c587e86c67896a9e7347600447b /src/purgatory/helpers.rs | |
| parent | 3f14f998d64b5fa15bdddd7570b4f72874eb9f29 (diff) | |
chore: cargo fmt
Diffstat (limited to 'src/purgatory/helpers.rs')
| -rw-r--r-- | src/purgatory/helpers.rs | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/src/purgatory/helpers.rs b/src/purgatory/helpers.rs index 93dc378..193ef99 100644 --- a/src/purgatory/helpers.rs +++ b/src/purgatory/helpers.rs | |||
| @@ -515,7 +515,7 @@ mod tests { | |||
| 515 | 515 | ||
| 516 | // Create a working repo to generate a commit | 516 | // Create a working repo to generate a commit |
| 517 | let work_dir = tempfile::tempdir().unwrap(); | 517 | let work_dir = tempfile::tempdir().unwrap(); |
| 518 | 518 | ||
| 519 | Command::new("git") | 519 | Command::new("git") |
| 520 | .args(["init"]) | 520 | .args(["init"]) |
| 521 | .current_dir(work_dir.path()) | 521 | .current_dir(work_dir.path()) |
| @@ -585,7 +585,7 @@ mod tests { | |||
| 585 | use std::process::Command; | 585 | use std::process::Command; |
| 586 | 586 | ||
| 587 | let temp_dir = tempfile::tempdir().unwrap(); | 587 | let temp_dir = tempfile::tempdir().unwrap(); |
| 588 | 588 | ||
| 589 | Command::new("git") | 589 | Command::new("git") |
| 590 | .args(["init", "--bare"]) | 590 | .args(["init", "--bare"]) |
| 591 | .current_dir(temp_dir.path()) | 591 | .current_dir(temp_dir.path()) |
| @@ -603,10 +603,7 @@ mod tests { | |||
| 603 | let commit_hash = commit_hash.expect("Should have a commit"); | 603 | let commit_hash = commit_hash.expect("Should have a commit"); |
| 604 | 604 | ||
| 605 | // Create a state event referencing that commit | 605 | // Create a state event referencing that commit |
| 606 | let event = create_test_state_event( | 606 | let event = create_test_state_event("test-repo", vec![("refs/heads/main", &commit_hash)]); |
| 607 | "test-repo", | ||
| 608 | vec![("refs/heads/main", &commit_hash)], | ||
| 609 | ); | ||
| 610 | 607 | ||
| 611 | // Should return true since the OID exists | 608 | // Should return true since the OID exists |
| 612 | assert!(can_apply_state(&event, repo_path)); | 609 | assert!(can_apply_state(&event, repo_path)); |
| @@ -621,7 +618,10 @@ mod tests { | |||
| 621 | // Create a state event referencing a non-existent commit | 618 | // Create a state event referencing a non-existent commit |
| 622 | let event = create_test_state_event( | 619 | let event = create_test_state_event( |
| 623 | "test-repo", | 620 | "test-repo", |
| 624 | vec![("refs/heads/main", "0000000000000000000000000000000000000000")], | 621 | vec![( |
| 622 | "refs/heads/main", | ||
| 623 | "0000000000000000000000000000000000000000", | ||
| 624 | )], | ||
| 625 | ); | 625 | ); |
| 626 | 626 | ||
| 627 | // Should return false since the OID doesn't exist | 627 | // Should return false since the OID doesn't exist |
| @@ -655,8 +655,8 @@ mod tests { | |||
| 655 | let event = create_test_state_event( | 655 | let event = create_test_state_event( |
| 656 | "test-repo", | 656 | "test-repo", |
| 657 | vec![ | 657 | vec![ |
| 658 | ("refs/heads/main", &commit_hash), // exists | 658 | ("refs/heads/main", &commit_hash), // exists |
| 659 | ("refs/heads/dev", "0000000000000000000000000000000000000000"), // doesn't exist | 659 | ("refs/heads/dev", "0000000000000000000000000000000000000000"), // doesn't exist |
| 660 | ], | 660 | ], |
| 661 | ); | 661 | ); |
| 662 | 662 | ||
| @@ -687,8 +687,8 @@ mod tests { | |||
| 687 | let event = create_test_state_event( | 687 | let event = create_test_state_event( |
| 688 | "test-repo", | 688 | "test-repo", |
| 689 | vec![ | 689 | vec![ |
| 690 | ("refs/heads/main", &commit_hash), // real OID that exists | 690 | ("refs/heads/main", &commit_hash), // real OID that exists |
| 691 | ("refs/heads/alias", "ref: refs/heads/main"), // symbolic ref | 691 | ("refs/heads/alias", "ref: refs/heads/main"), // symbolic ref |
| 692 | ], | 692 | ], |
| 693 | ); | 693 | ); |
| 694 | 694 | ||