Skip to content

Commit

Permalink
diff platform for basic diff configuration (#470)
Browse files Browse the repository at this point in the history
  • Loading branch information
Byron committed Sep 19, 2022
1 parent a938fe4 commit c857b9b
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 3 deletions.
25 changes: 24 additions & 1 deletion git-repository/src/object/tree/mod.rs
Expand Up @@ -22,7 +22,7 @@ impl<'repo> Tree<'repo> {
Id::from_id(self.id, self.repo)
}

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

#[allow(missing_docs)]
///
pub mod diff {
use crate::Tree;

impl<'repo> Tree<'repo> {
pub fn changes<'other_repo, 'a>(&'a self) -> Platform<'a, 'repo> {
Platform { lhs: self }
}
}

#[allow(dead_code)]
pub struct Platform<'a, 'repo> {
lhs: &'a Tree<'repo>,
}

impl<'a, 'repo> Platform<'a, 'repo> {
pub fn to_obtain_tree(&self, _other: &Tree<'_>) {
todo!()
}
}
}

///
pub mod traverse;

Expand Down
4 changes: 2 additions & 2 deletions git-repository/src/object/tree/traverse.rs
Expand Up @@ -15,11 +15,11 @@ impl<'repo> Tree<'repo> {
/// An intermediate object to start traversing the parent tree from.
pub struct Platform<'a, 'repo> {
root: &'a Tree<'repo>,
/// TODO: EXPLAIN
#[allow(missing_docs)] // TODO
pub breadthfirst: BreadthFirstPresets<'a, 'repo>,
}

/// TODO: explain THIS!
#[allow(missing_docs)] // TODO
#[derive(Copy, Clone)]
pub struct BreadthFirstPresets<'a, 'repo> {
root: &'a Tree<'repo>,
Expand Down

0 comments on commit c857b9b

Please sign in to comment.