(
path: &str,
new_content: &[u8],
diff_lines: &[GitDiffLine],
kind: atomic_core::record::workflow::DetectionKind,
)
| 2925 | } |
| 2926 | |
| 2927 | fn record_git_diff_add_fast( |
| 2928 | path: &str, |
| 2929 | new_content: &[u8], |
| 2930 | diff_lines: &[GitDiffLine], |
| 2931 | kind: atomic_core::record::workflow::DetectionKind, |
| 2932 | ) -> Option<RecordedFile> { |
| 2933 | let encoding = Encoding::detect(new_content); |
| 2934 | if encoding == Encoding::Binary { |
| 2935 | return None; |
| 2936 | } |
| 2937 | |
| 2938 | let mut recorded = RecordedFile::new(path); |
| 2939 | recorded.set_kind(kind); |
| 2940 | recorded.set_encoding(encoding); |
| 2941 | recorded.add_hunk(BuiltHunk::new_edit( |
| 2942 | Local::new(path, 1), |
| 2943 | Some(encoding), |
| 2944 | 0, |
| 2945 | new_content.len() as u64, |
| 2946 | )); |
| 2947 | recorded.set_content(new_content.to_vec()); |
| 2948 | |
| 2949 | let (git_file_ops, git_stats) = |
| 2950 | atomic_core::record::workflow::build_crdt_ops_from_git_diff(path, diff_lines); |
| 2951 | recorded.set_crdt_ops(git_file_ops); |
| 2952 | recorded.set_crdt_stats(git_stats); |
| 2953 | Some(recorded) |
| 2954 | } |
| 2955 | |
| 2956 | fn build_linewise_crdt_ops_for_added_file( |
| 2957 | path: &str, |
nothing calls this directly
no test coverage detected