nicegit 0.0.1

A collection of common higher-level abstractions over git2.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
use git2::{TreeEntry, ObjectType};

/// A set of extension methods for the `Tree` type in `git2`.
pub trait TreeEntryExt {
    /// Returns whether this entry in the tree represents a subtree, which would be a subdirectory
    /// on disk.
    fn is_dir(&self) -> bool;
}

impl<'repo> TreeEntryExt for TreeEntry<'repo> {
    fn is_dir(&self) -> bool {

        match self.kind() {
            Some(ObjectType::Tree) => true,
            _ => false
        }
    }
}