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

Function test_add_run_already_tracked

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

Source from the content-addressed store, hash-verified

910 #[test]
911 #[serial]
912 fn test_add_run_already_tracked() {
913 let _guard = DirGuard::new();
914
915 let temp_dir = tempfile::tempdir().unwrap();
916 let repo_path = temp_dir.path();
917
918 // Initialize repository
919 {
920 let repo = Repository::init(repo_path).unwrap();
921
922 // Create and add a file
923 std::fs::write(repo_path.join("test.txt"), "Hello").unwrap();
924 repo.add("test.txt", TrackingOptions::default()).unwrap();
925 }
926
927 std::env::set_current_dir(repo_path).unwrap();
928
929 // Try to add again
930 let add = Add::new().with_files(vec!["test.txt"]);
931 let result = add.run();
932
933 // Should succeed (skips already tracked files)
934 assert!(result.is_ok(), "Add failed: {:?}", result.err());
935 }
936
937 #[test]
938 #[serial]

Callers

nothing calls this directly

Calls 6

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

Tested by

no test coverage detected