History

First sketch of diff API

Sebastian Thiel committed 5 years ago

Commit fc3f2b71 parent ae3eab63 files · +46 −2Browse files

Showing the changes to git-diff/src (1 of 3 files). Show all

Unified · Split

git-diff/src/lib.rs+13−0
@@ -1 +1,14 @@
1+// TODO: add deny(missing_docs)
12 #![forbid(unsafe_code, rust_2018_idioms)]
3+
4+pub struct Tree<'a>(pub &'a git_object::immutable::Tree<'a>);
5+
6+const EMPTY_TREE: git_object::immutable::Tree<'static> = git_object::immutable::Tree::empty();
7+
8+impl<'a> Tree<'a> {
9+ /// Returns the changes that need to be applied to `other` to get `self`.
10+ pub fn changes_from(&self, other: Option<&git_object::immutable::Tree<'_>>) {
11+ let other = other.unwrap_or(&EMPTY_TREE);
12+ todo!("changes tree to tree")
13+ }
14+}