summaryrefslogtreecommitdiff
path: root/src/main.rs
blob: 9f8344b123c917b9a36d7d75a64247a228c025b9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
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");
                    }
                }
            })
        })
}