aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKatharina Fey <kookie@spacekookie.de>2019-12-29 00:56:20 +0100
committerKatharina Fey <kookie@spacekookie.de>2019-12-29 00:56:20 +0100
commit4be56ee336b52b6912b2b08d84074b969ae5efb2 (patch)
tree3bac75b51e8fb343d8e976dc0aec6a0db0e07288
parent81ae20b5a0bca84166076d91b8b32a19d2d451ae (diff)
Adding a small limgit2 example usage
-rw-r--r--.gitignore1
-rw-r--r--src/main.rs18
2 files changed, 17 insertions, 2 deletions
diff --git a/.gitignore b/.gitignore
index 53eaa21..91ea909 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,2 +1,3 @@
/target
**/*.rs.bk
+testrepo \ No newline at end of file
diff --git a/src/main.rs b/src/main.rs
index 77288a7..ed633e0 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -4,7 +4,7 @@ mod repo;
fn main() -> std::io::Result<()> {
// use actix_files as fs;
// use actix_web::{web, App, HttpServer};
-
+
// start http server
// HttpServer::new(move || {
// App::new()
@@ -14,6 +14,20 @@ fn main() -> std::io::Result<()> {
// .bind("127.0.0.1:8080")?
// .run()?;
- //let r = repo::Repo::new("./test");
+ let r = repo::Repo::new("./testrepo");
+ let mut walker = r.inner.revwalk().unwrap();
+ walker.push_head().unwrap();
+ dbg!(walker
+ .into_iter()
+ .map(|oid| {
+ let oid = oid.unwrap();
+ r.inner
+ .find_commit(oid)
+ .unwrap()
+ .message()
+ .unwrap()
+ .to_owned()
+ })
+ .collect::<Vec<_>>());
Ok(())
}