Skip to content

Commit

Permalink
feat: SignatureRef::actor() to more easily compare name and email. (#…
Browse files Browse the repository at this point in the history
…427)

Comparing anything with actual timestamps will of cause fail eventually
and make tests flaky.
  • Loading branch information
Byron committed Jul 30, 2022
1 parent 34c8140 commit 027c43c
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion git-actor/src/signature/mod.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
mod _ref {
use bstr::ByteSlice;
use bstr::{BStr, ByteSlice};

use crate::{signature::decode, Signature, SignatureRef};

Expand Down Expand Up @@ -29,6 +29,11 @@ mod _ref {
time: self.time,
}
}

/// Return the actor's name and email, effectively exclusing the time stamp of this signature.
pub fn actor(&self) -> (&BStr, &BStr) {
(self.name, self.email)
}
}
}

Expand Down

0 comments on commit 027c43c

Please sign in to comment.