From eac42979146e10ed740f62c2ba6d09bf410f1187 Mon Sep 17 00:00:00 2001 From: Mx Kookie Date: Sun, 8 Nov 2020 20:05:34 +0100 Subject: octopus: implementing supergit basic tree abstraction --- apps/servers/octopus/supergit/src/bin/test.rs | 31 ++++++--------------------- 1 file changed, 7 insertions(+), 24 deletions(-) (limited to 'apps/servers/octopus/supergit/src/bin') diff --git a/apps/servers/octopus/supergit/src/bin/test.rs b/apps/servers/octopus/supergit/src/bin/test.rs index 25652ed0bd34..c4fcc2fbb3a8 100644 --- a/apps/servers/octopus/supergit/src/bin/test.rs +++ b/apps/servers/octopus/supergit/src/bin/test.rs @@ -13,31 +13,14 @@ fn main() { }; let repo = Repository::open(path.as_str()).unwrap(); - - let (tx, rx) = channel(); let branches = repo.branches().unwrap(); - - branches + let main = branches .into_iter() - .filter(|b| b.name == Some("main".to_string())) - .for_each(|b| tx.send(b.get_all()).unwrap()); - - // Iterate over all branch iterators we get - while let Some(biter) = rx.recv().ok() { - use BranchCommit::*; + .filter(|b| b.name() == Some("master".to_string())) + .nth(0) + .unwrap(); - biter.for_each(|bc| match bc { - Commit(c) => println!("{}: {}", c.id_str(), c.summary()), - Merge(c, _b) => { - println!("{}: {}", c.id_str(), c.summary()); - tx.send(_b.get_all()).unwrap(); - } - Octopus(c, branches) => { - println!("{}: {}", c.id_str(), c.summary()); - for _b in branches { - tx.send(_b.get_all()).unwrap(); - } - } - }); - } + let head = main.get_head(); + let tree = head.get_tree(); + } -- cgit v1.2.3