aboutsummaryrefslogtreecommitdiff
path: root/apps/servers/octopus/supergit/src/bin
diff options
context:
space:
mode:
authorMx Kookie <kookie@spacekookie.de>2020-11-08 20:05:34 +0100
committerMx Kookie <kookie@spacekookie.de>2020-12-21 05:19:44 +0100
commiteac42979146e10ed740f62c2ba6d09bf410f1187 (patch)
tree660287979f3ac419717afbb9c49b45ad48774099 /apps/servers/octopus/supergit/src/bin
parent4c4d16d58c3d594938aa3ded26aa7e2fcebfc829 (diff)
octopus: implementing supergit basic tree abstraction
Diffstat (limited to 'apps/servers/octopus/supergit/src/bin')
-rw-r--r--apps/servers/octopus/supergit/src/bin/test.rs31
1 files changed, 7 insertions, 24 deletions
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();
+
}