Skip to content

Commit

Permalink
libgit2: Update for changes to commit APIs
Browse files Browse the repository at this point in the history
  • Loading branch information
bnjmnt4n committed Mar 2, 2024
1 parent 692efaf commit bea239e
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions libgit2-sys/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2893,7 +2893,7 @@ extern "C" {
message: *const c_char,
tree: *const git_tree,
parent_count: size_t,
parents: *mut *const git_commit,
parents: *const *mut git_commit,
) -> c_int;
pub fn git_commit_create_buffer(
out: *mut git_buf,
Expand All @@ -2904,7 +2904,7 @@ extern "C" {
message: *const c_char,
tree: *const git_tree,
parent_count: size_t,
parents: *mut *const git_commit,
parents: *const *mut git_commit,
) -> c_int;
pub fn git_commit_header_field(
out: *mut git_buf,
Expand Down
12 changes: 6 additions & 6 deletions src/repo.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1290,9 +1290,9 @@ impl Repository {
parents: &[&Commit<'_>],
) -> Result<Oid, Error> {
let update_ref = crate::opt_cstr(update_ref)?;
let mut parent_ptrs = parents
let parent_ptrs = parents
.iter()
.map(|p| p.raw() as *const raw::git_commit)
.map(|p| p.raw() as *mut raw::git_commit)
.collect::<Vec<_>>();
let message = CString::new(message)?;
let mut raw = raw::git_oid {
Expand All @@ -1309,7 +1309,7 @@ impl Repository {
message,
tree.raw(),
parents.len() as size_t,
parent_ptrs.as_mut_ptr()
parent_ptrs.as_ptr()
));
Ok(Binding::from_raw(&raw as *const _))
}
Expand All @@ -1328,9 +1328,9 @@ impl Repository {
tree: &Tree<'_>,
parents: &[&Commit<'_>],
) -> Result<Buf, Error> {
let mut parent_ptrs = parents
let parent_ptrs = parents
.iter()
.map(|p| p.raw() as *const raw::git_commit)
.map(|p| p.raw() as *mut raw::git_commit)
.collect::<Vec<_>>();
let message = CString::new(message)?;
let buf = Buf::new();
Expand All @@ -1344,7 +1344,7 @@ impl Repository {
message,
tree.raw(),
parents.len() as size_t,
parent_ptrs.as_mut_ptr()
parent_ptrs.as_ptr()
));
Ok(buf)
}
Expand Down

0 comments on commit bea239e

Please sign in to comment.