last-git-commit 0.2.0

Simple wrapper arround git2-rs to get info about the last commit. Useful for when you want to show the git hash in a program.
Documentation
use last_git_commit::LastGitCommit;

/**
 * Branch Tests
 */

#[test]
fn branch_none() {

    let lgc = LastGitCommit::new().build().unwrap();
    let branch = lgc.branch();

    assert_eq!(branch, &"master".to_string());

}

#[test]
fn branch_custom() {

    let custom_branch = "_tests_";
    let lgc = LastGitCommit::new().set_branch(custom_branch).build().unwrap();
    let branch = lgc.branch();

    assert_eq!(branch, &custom_branch.to_string());
    assert_ne!(branch, &"master".to_string());

}