Skip to content

Commit 9e064ab

Browse files
committed
libgit2-sys: Add bindings for git_tree_create_updated and related types
1 parent 1ff740d commit 9e064ab

File tree

2 files changed

+23
-1
lines changed

2 files changed

+23
-1
lines changed

libgit2-sys/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "libgit2-sys"
3-
version = "0.12.15+1.1.0"
3+
version = "0.12.16+1.1.0"
44
authors = ["Josh Triplett <[email protected]>", "Alex Crichton <[email protected]>"]
55
links = "git2"
66
build = "build.rs"

libgit2-sys/lib.rs

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

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

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

25342556
// treebuilder
25352557
pub fn git_treebuilder_new(

0 commit comments

Comments
 (0)