| 1329 | #[test] |
| 1330 | #[file_serial] |
| 1331 | fn test_add_with_unicode_filename() { |
| 1332 | let _guard = DirGuard::new(); |
| 1333 | |
| 1334 | let temp_dir = tempfile::tempdir().unwrap(); |
| 1335 | let repo_path = temp_dir.path(); |
| 1336 | |
| 1337 | // Initialize repository |
| 1338 | { |
| 1339 | let _repo = Repository::init(repo_path).unwrap(); |
| 1340 | } |
| 1341 | |
| 1342 | // Create a file with unicode name |
| 1343 | std::fs::write(repo_path.join("文件.txt"), "内容").unwrap(); |
| 1344 | |
| 1345 | std::env::set_current_dir(repo_path).unwrap(); |
| 1346 | |
| 1347 | let add = Add::new().with_files(vec!["文件.txt"]); |
| 1348 | let result = add.run(); |
| 1349 | |
| 1350 | assert!( |
| 1351 | result.is_ok(), |
| 1352 | "Add unicode file failed: {:?}", |
| 1353 | result.err() |
| 1354 | ); |
| 1355 | } |
| 1356 | |
| 1357 | #[test] |
| 1358 | #[file_serial] |