My personal project and infrastructure archive
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 
nomicon/apps/servers/octopus/supergit/src/bin/test.rs

33 lines
882 B

//! A test binary to use during development
use std::sync::mpsc::channel;
use supergit::{BranchCommit, Repository};
fn main() {
let path = match std::env::args().nth(1) {
Some(p) => p,
None => {
eprintln!("USAGE: supergit-test <path>");
std::process::exit(2);
}
};
let repo = Repository::open(path.as_str()).unwrap();
let branches = repo.branches().unwrap();
let main = branches
.into_iter()
.filter(|b| b.name() == Some("master".to_string()))
.nth(0)
.unwrap();
let head = main.get_head();
let tree = head.get_tree();
// println!(
// "{:?}",
// tree.history(main.get_all(), "infra/libkookie/nixpkgs/nixos/modules/module-list.nix")
// .into_iter()
// .map(|c| c.summary())
// .collect::<Vec<_>>()
// );
}