()
| 611 | |
| 612 | #[test] |
| 613 | fn test_find_repository_root_not_found() { |
| 614 | let temp = TempDir::new().unwrap(); |
| 615 | |
| 616 | // On some CI environments (especially Windows), a .atomic directory |
| 617 | // may exist somewhere above the temp dir in the filesystem hierarchy. |
| 618 | // Verify the precondition before asserting, and skip gracefully if not met. |
| 619 | let has_atomic_ancestor = { |
| 620 | let mut check = temp.path().to_path_buf(); |
| 621 | let mut found = false; |
| 622 | loop { |
| 623 | if check.join(DOT_DIR).is_dir() { |
| 624 | found = true; |
| 625 | break; |
| 626 | } |
| 627 | if !check.pop() { |
| 628 | break; |
| 629 | } |
| 630 | } |
| 631 | found |
| 632 | }; |
| 633 | if has_atomic_ancestor { |
| 634 | // A real .atomic dir exists above the temp dir; this test cannot |
| 635 | // reliably assert "not found" in this environment — skip it. |
| 636 | return; |
| 637 | } |
| 638 | |
| 639 | let result = find_repository_root_from(temp.path()); |
| 640 | assert!(result.is_err()); |
| 641 | assert!(matches!( |
| 642 | result.unwrap_err(), |
| 643 | CliError::RepositoryNotFound { .. } |
| 644 | )); |
| 645 | } |
| 646 | |
| 647 | #[test] |
| 648 | fn test_find_repository_root_in_current() { |
nothing calls this directly
no test coverage detected