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

Function test_add_run_with_force

atomic-cli/src/commands/add.rs:1089–1109  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1087 #[test]
1088 #[file_serial]
1089 fn test_add_run_with_force() {
1090 let _guard = DirGuard::new();
1091
1092 let temp_dir = tempfile::tempdir().unwrap();
1093 let repo_path = temp_dir.path();
1094
1095 // Initialize repository
1096 {
1097 let _repo = Repository::init(repo_path).unwrap();
1098 }
1099
1100 // Create a file
1101 std::fs::write(repo_path.join("test.txt"), "Hello").unwrap();
1102
1103 std::env::set_current_dir(repo_path).unwrap();
1104
1105 let add = Add::new().with_files(vec!["test.txt"]).with_force(true);
1106 let result = add.run();
1107
1108 assert!(result.is_ok(), "Add with force failed: {:?}", result.err());
1109 }
1110
1111 #[test]
1112 #[file_serial]

Callers

nothing calls this directly

Calls 7

initFunction · 0.50
writeFunction · 0.50
unwrapMethod · 0.45
pathMethod · 0.45
with_forceMethod · 0.45
with_filesMethod · 0.45
runMethod · 0.45

Tested by

no test coverage detected