()
| 788 | |
| 789 | #[test] |
| 790 | fn test_find_repository_root_in_parent() { |
| 791 | let temp = TempDir::new().unwrap(); |
| 792 | let _repo = Repository::init(temp.path()).unwrap(); |
| 793 | |
| 794 | let subdir = temp.path().join("subdir").join("deep"); |
| 795 | std::fs::create_dir_all(&subdir).unwrap(); |
| 796 | |
| 797 | let result = find_repository_root_from(&subdir); |
| 798 | assert!(result.is_ok()); |
| 799 | // Compare canonical paths to handle macOS /private/var vs /var symlinks |
| 800 | let expected = temp |
| 801 | .path() |
| 802 | .canonicalize() |
| 803 | .unwrap_or_else(|_| temp.path().to_path_buf()); |
| 804 | let actual = result.unwrap(); |
| 805 | assert_eq!(actual, expected); |
| 806 | } |
| 807 | |
| 808 | #[test] |
| 809 | fn test_find_repository_root_skips_config_directory() { |
nothing calls this directly
no test coverage detected