Skip to content

Commit b1adfc5

Browse files
committed
support partial stashing #929
1 parent 88c67f7 commit b1adfc5

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
@@ -1731,6 +1731,7 @@ git_enum! {
17311731
GIT_STASH_KEEP_INDEX = 1 << 0,
17321732
GIT_STASH_INCLUDE_UNTRACKED = 1 << 1,
17331733
GIT_STASH_INCLUDE_IGNORED = 1 << 2,
1734+
GIT_STASH_KEEP_ALL = 1 << 3,
17341735
}
17351736
}
17361737

@@ -1754,6 +1755,17 @@ git_enum! {
17541755
}
17551756
}
17561757

1758+
#[repr(C)]
1759+
pub struct git_stash_save_options {
1760+
pub version: c_uint,
1761+
pub flags: c_uint,
1762+
pub stasher: *const git_signature,
1763+
pub message: *const c_char,
1764+
pub paths: git_strarray,
1765+
}
1766+
1767+
pub const GIT_STASH_SAVE_OPTIONS_VERSION: c_uint = 1;
1768+
17571769
#[repr(C)]
17581770
pub struct git_stash_apply_options {
17591771
pub version: c_uint,
@@ -2534,6 +2546,15 @@ extern "C" {
25342546
flags: c_uint,
25352547
) -> c_int;
25362548

2549+
pub fn git_stash_save_options_init(opts: *mut git_stash_save_options, version: c_uint)
2550+
-> c_int;
2551+
2552+
pub fn git_stash_save_with_opts(
2553+
out: *mut git_oid,
2554+
repo: *mut git_repository,
2555+
options: *const git_stash_save_options,
2556+
) -> c_int;
2557+
25372558
pub fn git_stash_apply_init_options(
25382559
opts: *mut git_stash_apply_options,
25392560
version: c_uint,

src/lib.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1465,6 +1465,8 @@ bitflags! {
14651465
/// All ignored files are also stashed and then cleaned up from
14661466
/// the working directory
14671467
const INCLUDE_IGNORED = raw::GIT_STASH_INCLUDE_IGNORED as u32;
1468+
/// All changes in the index and working directory are left intact
1469+
const KEEP_ALL = raw::GIT_STASH_KEEP_ALL as u32;
14681470
}
14691471
}
14701472

0 commit comments

Comments
 (0)