Create a simple test FileAdd graph_op
()
| 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 | } |
no outgoing calls