summaryrefslogtreecommitdiffstats
path: root/vendor/gix/src/object/commit.rs
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-30 18:31:44 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-30 18:31:44 +0000
commitc23a457e72abe608715ac76f076f47dc42af07a5 (patch)
tree2772049aaf84b5c9d0ed12ec8d86812f7a7904b6 /vendor/gix/src/object/commit.rs
parentReleasing progress-linux version 1.73.0+dfsg1-1~progress7.99u1. (diff)
downloadrustc-c23a457e72abe608715ac76f076f47dc42af07a5.tar.xz
rustc-c23a457e72abe608715ac76f076f47dc42af07a5.zip
Merging upstream version 1.74.1+dfsg1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'vendor/gix/src/object/commit.rs')
-rw-r--r--vendor/gix/src/object/commit.rs16
1 files changed, 13 insertions, 3 deletions
diff --git a/vendor/gix/src/object/commit.rs b/vendor/gix/src/object/commit.rs
index 5a9dfd4f3..1fb9eff67 100644
--- a/vendor/gix/src/object/commit.rs
+++ b/vendor/gix/src/object/commit.rs
@@ -1,4 +1,4 @@
-use crate::{bstr, bstr::BStr, revision, Commit, ObjectDetached, Tree};
+use crate::{bstr, bstr::BStr, Commit, ObjectDetached, Tree};
mod error {
use crate::object;
@@ -65,7 +65,7 @@ impl<'repo> Commit<'repo> {
/// Decode the commit and obtain the time at which the commit was created.
///
/// For the time at which it was authored, refer to `.decode()?.author.time`.
- pub fn time(&self) -> Result<gix_actor::Time, Error> {
+ pub fn time(&self) -> Result<gix_date::Time, Error> {
Ok(self.committer()?.time)
}
@@ -131,12 +131,13 @@ impl<'repo> Commit<'repo> {
}
/// Obtain a platform for traversing ancestors of this commit.
- pub fn ancestors(&self) -> revision::walk::Platform<'repo> {
+ pub fn ancestors(&self) -> crate::revision::walk::Platform<'repo> {
self.id().ancestors()
}
/// Create a platform to further configure a `git describe` operation to find a name for this commit by looking
/// at the closest annotated tags (by default) in its past.
+ #[cfg(feature = "revision")]
pub fn describe(&self) -> crate::commit::describe::Platform<'repo> {
crate::commit::describe::Platform {
id: self.id,
@@ -147,6 +148,15 @@ impl<'repo> Commit<'repo> {
max_candidates: 10,
}
}
+
+ /// Extracts the PGP signature and the data that was used to create the signature, or `None` if it wasn't signed.
+ // TODO: make it possible to verify the signature, probably by wrapping `SignedData`. It's quite some work to do it properly.
+ pub fn signature(
+ &self,
+ ) -> Result<Option<(std::borrow::Cow<'_, BStr>, gix_object::commit::SignedData<'_>)>, gix_object::decode::Error>
+ {
+ gix_object::CommitRefIter::signature(&self.data)
+ }
}
impl<'r> std::fmt::Debug for Commit<'r> {