Skip to content

Commit 047f653

Browse files
committed
libgit2-sys: Add bindings for git_tree_create_updated and related types
1 parent eca10db commit 047f653

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

libgit2-sys/lib.rs

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -704,6 +704,21 @@ pub type git_treebuilder_filter_cb =
704704

705705
pub type git_revwalk_hide_cb = Option<extern "C" fn(*const git_oid, *mut c_void) -> c_int>;
706706

707+
git_enum! {
708+
pub enum git_tree_update_t {
709+
GIT_TREE_UPDATE_UPSERT = 0,
710+
GIT_TREE_UPDATE_REMOVE = 1,
711+
}
712+
}
713+
714+
#[repr(C)]
715+
pub struct git_tree_update {
716+
pub action: git_tree_update_t,
717+
pub id: git_oid,
718+
pub filemode: git_filemode_t,
719+
pub path: *const c_char,
720+
}
721+
707722
#[repr(C)]
708723
#[derive(Copy, Clone)]
709724
pub struct git_buf {
@@ -2531,6 +2546,13 @@ extern "C" {
25312546
callback: git_treewalk_cb,
25322547
payload: *mut c_void,
25332548
) -> c_int;
2549+
pub fn git_tree_create_updated(
2550+
out: *mut git_oid,
2551+
repo: *mut git_repository,
2552+
baseline: *mut git_tree,
2553+
nupdates: usize,
2554+
updates: *const git_tree_update,
2555+
) -> c_int;
25342556

25352557
// treebuilder
25362558
pub fn git_treebuilder_new(

0 commit comments

Comments
 (0)