()
| 937 | #[test] |
| 938 | #[serial] |
| 939 | fn test_add_run_with_force() { |
| 940 | let _guard = DirGuard::new(); |
| 941 | |
| 942 | let temp_dir = tempfile::tempdir().unwrap(); |
| 943 | let repo_path = temp_dir.path(); |
| 944 | |
| 945 | // Initialize repository |
| 946 | { |
| 947 | let _repo = Repository::init(repo_path).unwrap(); |
| 948 | } |
| 949 | |
| 950 | // Create a file |
| 951 | std::fs::write(repo_path.join("test.txt"), "Hello").unwrap(); |
| 952 | |
| 953 | std::env::set_current_dir(repo_path).unwrap(); |
| 954 | |
| 955 | let add = Add::new().with_files(vec!["test.txt"]).with_force(true); |
| 956 | let result = add.run(); |
| 957 | |
| 958 | assert!(result.is_ok(), "Add with force failed: {:?}", result.err()); |
| 959 | } |
| 960 | |
| 961 | #[test] |
| 962 | #[serial] |
nothing calls this directly
no test coverage detected