Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions gix-blame/src/file/function.rs
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ pub fn file(
let (mut buf, mut buf2) = (Vec::new(), Vec::new());
let commit = find_commit(cache.as_ref(), &odb, &suspect, &mut buf)?;
let mut queue: gix_revwalk::PriorityQueue<CommitTime, ObjectId> = gix_revwalk::PriorityQueue::new();
queue.insert(commit_time(&commit)?, suspect);
queue.insert(commit_time(commit)?, suspect);

let mut out = Vec::new();
let mut diff_state = gix_diff::tree::State::default();
Expand All @@ -122,7 +122,7 @@ pub fn file(
}

let commit = find_commit(cache.as_ref(), &odb, &suspect, &mut buf)?;
let commit_time = commit_time(&commit)?;
let commit_time = commit_time(commit)?;

if let Some(since) = options.since {
if commit_time < since.seconds {
Expand Down Expand Up @@ -669,7 +669,7 @@ fn find_path_entry_in_commit(

type CommitTime = i64;

fn commit_time(commit: &gix_traverse::commit::Either<'_, '_>) -> Result<CommitTime, gix_object::decode::Error> {
fn commit_time(commit: gix_traverse::commit::Either<'_, '_>) -> Result<CommitTime, gix_object::decode::Error> {
match commit {
gix_traverse::commit::Either::CommitRefIter(commit_ref_iter) => {
commit_ref_iter.committer().map(|c| c.time.seconds)
Expand Down
1 change: 1 addition & 0 deletions gix-traverse/src/commit/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ pub struct Info {

/// Information about a commit that can be obtained either from a [`gix_object::CommitRefIter`] or
/// a [`gix_commitgraph::file::Commit`].
#[derive(Clone, Copy)]
pub enum Either<'buf, 'cache> {
/// See [`gix_object::CommitRefIter`].
CommitRefIter(gix_object::CommitRefIter<'buf>),
Expand Down
Loading