Skip to content

Commit c857b9b

Browse files
committed
diff platform for basic diff configuration (#470)
1 parent a938fe4 commit c857b9b

File tree

2 files changed

+26
-3
lines changed

2 files changed

+26
-3
lines changed

Diff for: git-repository/src/object/tree/mod.rs

+24-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ impl<'repo> Tree<'repo> {
2222
Id::from_id(self.id, self.repo)
2323
}
2424

25-
// TODO: move implementation to git-object, tests.
25+
// TODO: tests.
2626
/// Follow a sequence of `path` components starting from this instance, and look them up one by one until the last component
2727
/// is looked up and its tree entry is returned.
2828
///
@@ -62,6 +62,29 @@ impl<'repo> Tree<'repo> {
6262
}
6363
}
6464

65+
#[allow(missing_docs)]
66+
///
67+
pub mod diff {
68+
use crate::Tree;
69+
70+
impl<'repo> Tree<'repo> {
71+
pub fn changes<'other_repo, 'a>(&'a self) -> Platform<'a, 'repo> {
72+
Platform { lhs: self }
73+
}
74+
}
75+
76+
#[allow(dead_code)]
77+
pub struct Platform<'a, 'repo> {
78+
lhs: &'a Tree<'repo>,
79+
}
80+
81+
impl<'a, 'repo> Platform<'a, 'repo> {
82+
pub fn to_obtain_tree(&self, _other: &Tree<'_>) {
83+
todo!()
84+
}
85+
}
86+
}
87+
6588
///
6689
pub mod traverse;
6790

Diff for: git-repository/src/object/tree/traverse.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,11 @@ impl<'repo> Tree<'repo> {
1515
/// An intermediate object to start traversing the parent tree from.
1616
pub struct Platform<'a, 'repo> {
1717
root: &'a Tree<'repo>,
18-
/// TODO: EXPLAIN
18+
#[allow(missing_docs)] // TODO
1919
pub breadthfirst: BreadthFirstPresets<'a, 'repo>,
2020
}
2121

22-
/// TODO: explain THIS!
22+
#[allow(missing_docs)] // TODO
2323
#[derive(Copy, Clone)]
2424
pub struct BreadthFirstPresets<'a, 'repo> {
2525
root: &'a Tree<'repo>,

0 commit comments

Comments
 (0)