summaryrefslogtreecommitdiffstats
path: root/vendor/git2/src/repo.rs
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-30 03:57:31 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-30 03:57:31 +0000
commitdc0db358abe19481e475e10c32149b53370f1a1c (patch)
treeab8ce99c4b255ce46f99ef402c27916055b899ee /vendor/git2/src/repo.rs
parentReleasing progress-linux version 1.71.1+dfsg1-2~progress7.99u1. (diff)
downloadrustc-dc0db358abe19481e475e10c32149b53370f1a1c.tar.xz
rustc-dc0db358abe19481e475e10c32149b53370f1a1c.zip
Merging upstream version 1.72.1+dfsg1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'vendor/git2/src/repo.rs')
-rw-r--r--vendor/git2/src/repo.rs21
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,