diff options
Diffstat (limited to 'vendor/git2/src/repo.rs')
-rw-r--r-- | vendor/git2/src/repo.rs | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/vendor/git2/src/repo.rs b/vendor/git2/src/repo.rs index a794939be..921e2b30e 100644 --- a/vendor/git2/src/repo.rs +++ b/vendor/git2/src/repo.rs @@ -12,7 +12,7 @@ use crate::diff::{ binary_cb_c, file_cb_c, hunk_cb_c, line_cb_c, BinaryCb, DiffCallbacks, FileCb, HunkCb, LineCb, }; use crate::oid_array::OidArray; -use crate::stash::{stash_cb, StashApplyOptions, StashCbData}; +use crate::stash::{stash_cb, StashApplyOptions, StashCbData, StashSaveOptions}; use crate::string_array::StringArray; use crate::tagforeach::{tag_foreach_cb, TagForeachCB, TagForeachData}; use crate::util::{self, path_to_repo_path, Binding}; @@ -2844,6 +2844,25 @@ impl Repository { } } + /// Like `stash_save` but with more options like selective statshing via path patterns. + pub fn stash_save_ext( + &mut self, + opts: Option<&mut StashSaveOptions<'_>>, + ) -> Result<Oid, Error> { + unsafe { + let mut raw_oid = raw::git_oid { + id: [0; raw::GIT_OID_RAWSZ], + }; + let opts = opts.map(|opts| opts.raw()); + try_call!(raw::git_stash_save_with_opts( + &mut raw_oid, + self.raw(), + opts + )); + Ok(Binding::from_raw(&raw_oid as *const _)) + } + } + /// Apply a single stashed state from the stash list. pub fn stash_apply( &mut self, |