Skip to content

Commit 006b5e9

Browse files
committed
support partial stashing #929
1 parent 59bb979 commit 006b5e9

File tree

2 files changed

+23
-0
lines changed

2 files changed

+23
-0
lines changed

libgit2-sys/lib.rs

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1717,6 +1717,7 @@ git_enum! {
17171717
GIT_STASH_KEEP_INDEX = 1 << 0,
17181718
GIT_STASH_INCLUDE_UNTRACKED = 1 << 1,
17191719
GIT_STASH_INCLUDE_IGNORED = 1 << 2,
1720+
GIT_STASH_KEEP_ALL = 1 << 3,
17201721
}
17211722
}
17221723

@@ -1740,6 +1741,17 @@ git_enum! {
17401741
}
17411742
}
17421743

1744+
#[repr(C)]
1745+
pub struct git_stash_save_options {
1746+
pub version: c_uint,
1747+
pub flags: c_uint,
1748+
pub stasher: *const git_signature,
1749+
pub message: *const c_char,
1750+
pub paths: git_strarray,
1751+
}
1752+
1753+
pub const GIT_STASH_SAVE_OPTIONS_VERSION: c_uint = 1;
1754+
17431755
#[repr(C)]
17441756
pub struct git_stash_apply_options {
17451757
pub version: c_uint,
@@ -2518,6 +2530,15 @@ extern "C" {
25182530
flags: c_uint,
25192531
) -> c_int;
25202532

2533+
pub fn git_stash_save_options_init(opts: *mut git_stash_save_options, version: c_uint)
2534+
-> c_int;
2535+
2536+
pub fn git_stash_save_with_opts(
2537+
out: *mut git_oid,
2538+
repo: *mut git_repository,
2539+
options: *const git_stash_save_options,
2540+
) -> c_int;
2541+
25212542
pub fn git_stash_apply_init_options(
25222543
opts: *mut git_stash_apply_options,
25232544
version: c_uint,

src/lib.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1459,6 +1459,8 @@ bitflags! {
14591459
/// All ignored files are also stashed and then cleaned up from
14601460
/// the working directory
14611461
const INCLUDE_IGNORED = raw::GIT_STASH_INCLUDE_IGNORED as u32;
1462+
/// All changes in the index and working directory are left intact
1463+
const KEEP_ALL = raw::GIT_STASH_KEEP_ALL as u32;
14621464
}
14631465
}
14641466

0 commit comments

Comments
 (0)