diff options
author | Zhongheng Liu <z.liu@outlook.com.gr> | 2024-12-24 11:54:52 +0200 |
---|---|---|
committer | Zhongheng Liu <z.liu@outlook.com.gr> | 2024-12-24 11:54:52 +0200 |
commit | 0c5d8d9146afea3894dad46eb672a2eb2a4dffb0 (patch) | |
tree | 13662cfb482f9e2ed586f51b421a7297e6a29198 /src/main.rs | |
parent | 02dddc35af5ad4c608ee1fa8206e1922b973413f (diff) | |
download | git_service-0c5d8d9146afea3894dad46eb672a2eb2a4dffb0.tar.gz git_service-0c5d8d9146afea3894dad46eb672a2eb2a4dffb0.tar.bz2 git_service-0c5d8d9146afea3894dad46eb672a2eb2a4dffb0.zip |
feat: libgit2 repo creation
Diffstat (limited to 'src/main.rs')
-rw-r--r-- | src/main.rs | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/src/main.rs b/src/main.rs new file mode 100644 index 0000000..9f8344b --- /dev/null +++ b/src/main.rs @@ -0,0 +1,27 @@ +use core::panic; + +use git2::BranchType; + +mod git_tools; + +fn main() { + println!("Hello, world!"); + let repository = match git_tools::make_repo("any_test.git", "z.liu@outlook.com.gr") { + Ok(repo) => repo, + Err(_e) => panic!("Something went wrong during repo init"), + }; + repository.branches(Some(BranchType::Local)).map_or_else(|_err| { + panic!("branch parse error") + }, |branches| { + branches.for_each(|branch_result| { + match branch_result { + Ok(branch) => { + println!("{:?}", branch.0.name().unwrap()); + }, + Err(_e) => { + panic!("error stuff"); + } + } + }) + }) +} |