Skip to content

Commit e4e8ddc

Browse files
committed
change!: rename commit::Sorting::ByCommitTimeNewestFirstCutoffOlderThan {time_in_seconds_since_epoch} to seconds.
This is possible now that there is a type for the time with that name.
1 parent 4a80e86 commit e4e8ddc

File tree

2 files changed

+8
-10
lines changed

2 files changed

+8
-10
lines changed

gix-traverse/src/commit.rs

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ pub enum Sorting {
6464
/// In the *sample history* and a cut-off date of 4, the returned list of commits would be `8, 7, 6, 4`
6565
ByCommitTimeNewestFirstCutoffOlderThan {
6666
/// The amount of seconds since unix epoch, the same value obtained by any `gix_date::Time` structure and the way git counts time.
67-
time_in_seconds_since_epoch: gix_date::SecondsSinceUnixEpoch,
67+
seconds: gix_date::SecondsSinceUnixEpoch,
6868
},
6969
}
7070

@@ -315,9 +315,9 @@ pub mod ancestors {
315315
match self.sorting {
316316
Sorting::BreadthFirst => self.next_by_topology(),
317317
Sorting::ByCommitTimeNewestFirst => self.next_by_commit_date(None),
318-
Sorting::ByCommitTimeNewestFirstCutoffOlderThan {
319-
time_in_seconds_since_epoch,
320-
} => self.next_by_commit_date(time_in_seconds_since_epoch.into()),
318+
Sorting::ByCommitTimeNewestFirstCutoffOlderThan { seconds } => {
319+
self.next_by_commit_date(seconds.into())
320+
}
321321
}
322322
}
323323
}
@@ -327,9 +327,7 @@ pub mod ancestors {
327327
/// If not topo sort, provide the cutoff date if present.
328328
fn cutoff_time(&self) -> Option<gix_date::SecondsSinceUnixEpoch> {
329329
match self {
330-
Sorting::ByCommitTimeNewestFirstCutoffOlderThan {
331-
time_in_seconds_since_epoch,
332-
} => Some(*time_in_seconds_since_epoch),
330+
Sorting::ByCommitTimeNewestFirstCutoffOlderThan { seconds } => Some(*seconds),
333331
_ => None,
334332
}
335333
}
@@ -407,7 +405,7 @@ pub mod ancestors {
407405
Some(Ok(Info {
408406
id: oid,
409407
parent_ids: parents,
410-
commit_time: Some(commit_time as u64),
408+
commit_time: Some(commit_time),
411409
}))
412410
}
413411
}

gix-traverse/tests/commit/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -388,7 +388,7 @@ mod ancestor {
388388
&["bcb05040a6925f2ff5e10d3ae1f9264f2e8c43ac"], /* b1c1 */
389389
)
390390
.with_sorting(Sorting::ByCommitTimeNewestFirstCutoffOlderThan {
391-
time_in_seconds_since_epoch: 978393600, // =2001-01-02 00:00:00 +0000
391+
seconds: 978393600, // =2001-01-02 00:00:00 +0000
392392
})
393393
.check()
394394
}
@@ -404,7 +404,7 @@ mod ancestor {
404404
move |oid, buf| store.find_commit_iter(oid, buf),
405405
)
406406
.sorting(Sorting::ByCommitTimeNewestFirstCutoffOlderThan {
407-
time_in_seconds_since_epoch: 978393600, // =2001-01-02 00:00:00 +0000
407+
seconds: 978393600, // =2001-01-02 00:00:00 +0000
408408
})?;
409409
assert_eq!(
410410
iter.count(),

0 commit comments

Comments
 (0)