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

Function test_status_in_subdirectory

atomic-cli/src/commands/status.rs:1310–1342  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1308 #[test]
1309 #[serial]
1310 fn test_status_in_subdirectory() {
1311 let _guard = DirGuard::new();
1312
1313 let temp_dir = tempfile::tempdir().unwrap();
1314 let repo_path = temp_dir.path();
1315
1316 // Initialize a repository and drop handle to release lock
1317 {
1318 let repo_result = Repository::init(repo_path);
1319 assert!(
1320 repo_result.is_ok(),
1321 "Failed to init repository: {:?}",
1322 repo_result.err()
1323 );
1324 }
1325
1326 // Create subdirectory
1327 let subdir = repo_path.join("subdir");
1328 std::fs::create_dir(&subdir).unwrap();
1329
1330 // Change to subdirectory
1331 std::env::set_current_dir(&subdir).unwrap();
1332
1333 let status = Status::new();
1334 let result = status.run();
1335
1336 // Should find repo by walking up to parent
1337 assert!(
1338 result.is_ok(),
1339 "Status in subdirectory failed: {:?}",
1340 result.err()
1341 );
1342 }
1343
1344 #[test]
1345 #[serial]

Callers

nothing calls this directly

Calls 3

unwrapMethod · 0.45
pathMethod · 0.45
runMethod · 0.45

Tested by

no test coverage detected