Use any branch activity to report idle time
- Id
- f47cbf03138f75b696d2e23a567e20c75d45e578
- Author
- Caio
- Commit time
- 2024-03-13T14:16:48+01:00
Modified caca/src/repo/mod.rs
}
pub fn idle(&self) -> DateTime {
- let head = self.snapshot.head.commit.author.time;
+ // XXX relying on sorted state
+ let tip = self
+ .snapshot
+ .branches
+ .first()
+ .map(|b| b.commit.author.time)
+ .unwrap_or_default();
if let Some(tag) = self.snapshot.tags.first() {
let tagged_at = tag.time();
- if tagged_at > head {
+ if tagged_at > tip {
return tagged_at;
}
}
- head
+ tip
}
fn repo_info(&self) -> Info<'_> {