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

Function create_test_file_add_hunk

atomic-core/src/record/builder.rs:1010–1037  ·  view source on GitHub ↗

Create a simple test FileAdd graph_op

()

Source from the content-addressed store, hash-verified

1008
1009 /// Create a simple test FileAdd graph_op
1010 fn create_test_file_add_hunk() -> GraphOp<Option<Hash>> {
1011 // For GraphOp<Option<Hash>>, positions use Option<Hash> as their change identifier
1012 // None means "this change" (the one being created)
1013 let inode_pos: Position<Option<Hash>> = Position::new(None, ChangePosition::new(0));
1014 let root_pos: Position<Option<Hash>> = Position::new(None, ChangePosition::new(0));
1015
1016 GraphOp::FileAdd {
1017 add_name: Insertion {
1018 predecessors: vec![root_pos],
1019 successors: vec![],
1020 flag: EdgeFlags::FOLDER | EdgeFlags::BLOCK,
1021 start: ChangePosition::new(0),
1022 end: ChangePosition::new(10),
1023 inode: inode_pos,
1024 },
1025 add_inode: Insertion {
1026 predecessors: vec![],
1027 successors: vec![],
1028 flag: EdgeFlags::FOLDER | EdgeFlags::BLOCK,
1029 start: ChangePosition::new(10),
1030 end: ChangePosition::new(20),
1031 inode: inode_pos,
1032 },
1033 contents: None,
1034 path: "test.txt".to_string(),
1035 encoding: Some(Encoding::Utf8),
1036 }
1037 }
1038}

Callers 10

test_add_hunkFunction · 0.85
test_add_multiple_hunksFunction · 0.85
test_add_inode_updateFunction · 0.85
test_finish_with_dataFunction · 0.85
test_clearFunction · 0.85
test_stats_populatedFunction · 0.85
test_recorded_into_partsFunction · 0.85
test_recorded_actionsFunction · 0.85

Calls

no outgoing calls

Tested by 10

test_add_hunkFunction · 0.68
test_add_multiple_hunksFunction · 0.68
test_add_inode_updateFunction · 0.68
test_finish_with_dataFunction · 0.68
test_clearFunction · 0.68
test_stats_populatedFunction · 0.68
test_recorded_into_partsFunction · 0.68
test_recorded_actionsFunction · 0.68