surf: Open Diff to custom construction

Put the Diff type in lines with its associated types by opening it up to
construction by crate consumers.  The existing associated types have all
their fields public.

Open construction up by making the `Diff::insert_*` methods public and
updating the Diff's stats manually.  `Diff::stat` correctness is covered
by existing tests.
This commit is contained in:
Slack Coder
2023-08-24 09:37:29 -05:00
parent a3d2cc80e0
commit e7b5f9a90b
2 changed files with 32 additions and 7 deletions
-1
View File
@@ -229,7 +229,6 @@ impl<'a> TryFrom<git2::Diff<'a>> for Diff {
use git2::Delta;
let mut diff = Diff::new();
diff.stats = git_diff.stats()?.into();
for (idx, delta) in git_diff.deltas().enumerate() {
match delta.status() {