Skip to content

Commit 8d2a86c

Browse files
committed
Fix test branch::tests::name_is_valid
The `Branch::name_is_valid` function allocates memory in `libgit2`, so we need to initialize the memory allocator first via `git_libgit2_init`.
1 parent b863968 commit 8d2a86c

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

src/branch.rs

+1
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ impl<'repo> Branch<'repo> {
3030

3131
/// Ensure the branch name is well-formed.
3232
pub fn name_is_valid(name: &str) -> Result<bool, Error> {
33+
crate::init();
3334
let name = CString::new(name)?;
3435
let mut valid: libc::c_int = 0;
3536
unsafe {

0 commit comments

Comments
 (0)