Would it be possible to introduce something like this to Repository? I'm not sure if the goals of this project are to keep it mapping to the libgit2 directly or not. I'm also not sure if allowing not requiring a mutable reference here is sound.
/// Count number of git stashes
pub fn stash_count(&self) -> Result<usize, Error> {
unsafe {
let mut count = 0;
let mut data = StashCbData {
callback: &mut |_, _, _| {
count += 1;
true
},
};
let cb: raw::git_stash_cb = Some(stash_cb);
try_call!(raw::git_stash_foreach(
self.raw(),
cb,
&mut data as *mut _ as *mut _
));
Ok(count)
}
}
Based of the stash_foreach implementation.
Would it be possible to introduce something like this to
Repository? I'm not sure if the goals of this project are to keep it mapping to the libgit2 directly or not. I'm also not sure if allowing not requiring a mutable reference here is sound.Based of the stash_foreach implementation.