parent
441b53ad83
commit
91fc2d1752
@ -1,38 +1,33 @@ |
|||||||
//! A test binary to use during development
|
//! A test binary to use during development
|
||||||
|
|
||||||
// use std::sync::mpsc::channel;
|
use supergit::Repository; |
||||||
// 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(), "Cargo.toml")
|
|
||||||
// .into_iter()
|
|
||||||
// .map(|c| c.summary())
|
|
||||||
// .collect::<Vec<_>>()
|
|
||||||
// );
|
|
||||||
// }
|
|
||||||
|
|
||||||
|
|
||||||
fn main() { |
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("main".to_string())) |
||||||
|
.nth(0) |
||||||
|
.unwrap(); |
||||||
|
|
||||||
|
let head = main.head(); |
||||||
|
let tree = head.tree(); |
||||||
|
|
||||||
|
println!( |
||||||
|
"{:#?}", |
||||||
|
tree.base_history(main.get_all(), "README.md") |
||||||
|
.unwrap() |
||||||
|
.into_iter() |
||||||
|
.map(|c| c.summary()) |
||||||
|
.collect::<Vec<_>>() |
||||||
|
); |
||||||
} |
} |
||||||
|
Loading…
Reference in new issue