MCPcopy Create free account
hub / github.com/atomicdotdev/atomic / test_find_repository_root_in_parent

Function test_find_repository_root_in_parent

atomic-cli/src/commands/mod.rs:790–806  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

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() {

Callers

nothing calls this directly

Calls 5

canonicalizeMethod · 0.80
initFunction · 0.50
unwrapMethod · 0.45
pathMethod · 0.45

Tested by

no test coverage detected