pub struct ShaResolver { /* private fields */ }Expand description
SHA resolver for Git references
Implementations§
Source§impl ShaResolver
impl ShaResolver
Sourcepub fn resolve_current_sha(&self, config: &InputConfig<'_>) -> Result<String>
pub fn resolve_current_sha(&self, config: &InputConfig<'_>) -> Result<String>
Resolve the current (head) SHA based on config and environment
Sourcepub fn resolve_base_sha(&self, config: &InputConfig<'_>) -> Result<String>
pub fn resolve_base_sha(&self, config: &InputConfig<'_>) -> Result<String>
Resolve the base SHA based on config and environment
Sourcepub fn merge_base(&self, commit1: &str, commit2: &str) -> Result<String>
pub fn merge_base(&self, commit1: &str, commit2: &str) -> Result<String>
Get merge base between two commits (for three-dot diff)
Sourcepub fn is_initial_commit(&self, sha: &str) -> Result<bool>
pub fn is_initial_commit(&self, sha: &str) -> Result<bool>
Check if this is an initial commit (no parent)
Sourcepub fn empty_tree_sha() -> &'static str
pub fn empty_tree_sha() -> &'static str
Get the empty tree SHA (for comparing against initial commits)
Sourcepub fn resolve_event_aware(
&self,
config: &InputConfig<'_>,
) -> Result<(String, String)>
pub fn resolve_event_aware( &self, config: &InputConfig<'_>, ) -> Result<(String, String)>
Event-aware SHA resolution with 8+ decision paths
Resolution priority:
- Explicit config (base_sha/sha) — always wins
- Event-specific logic (PR, Push, MergeGroup, Tag, etc.)
- Default fallback (HEAD^..HEAD)
Sourcepub fn find_previous_tag(&self, config: &InputConfig<'_>) -> Result<String>
pub fn find_previous_tag(&self, config: &InputConfig<'_>) -> Result<String>
Find the previous tag matching the configured pattern
Walks tags sorted by commit time, finds the most recent tag before HEAD
that matches tags_pattern and doesn’t match tags_ignore_pattern.
Auto Trait Implementations§
impl Freeze for ShaResolver
impl RefUnwindSafe for ShaResolver
impl Send for ShaResolver
impl Sync for ShaResolver
impl Unpin for ShaResolver
impl UnsafeUnpin for ShaResolver
impl UnwindSafe for ShaResolver
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more