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:939–959  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

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]

Callers

nothing calls this directly

Calls 6

writeFunction · 0.85
unwrapMethod · 0.45
pathMethod · 0.45
with_forceMethod · 0.45
with_filesMethod · 0.45
runMethod · 0.45

Tested by

no test coverage detected