diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/cgit_helper.rs | 3 | ||||
-rw-r--r-- | src/main.rs | 25 |
2 files changed, 15 insertions, 13 deletions
diff --git a/src/cgit_helper.rs b/src/cgit_helper.rs new file mode 100644 index 0000000..703f518 --- /dev/null +++ b/src/cgit_helper.rs @@ -0,0 +1,3 @@ +pub fn cgit_add_repo(cgit_repos_file_path: String) { + +} diff --git a/src/main.rs b/src/main.rs index 9f8344b..d517a6c 100644 --- a/src/main.rs +++ b/src/main.rs @@ -2,26 +2,25 @@ use core::panic; use git2::BranchType; +mod cgit_helper; 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"); - } + 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"); } }) - }) + }, + ) } |