Skip to content

Commit fd034e0

Browse files
committed
fix: make time conversion more robust
Previously it could easily fail if very old files are found, or future ones. Instead, such entries simply can't be compared quickly.
1 parent f066f98 commit fd034e0

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

gix-index/src/entry/stat.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,8 +95,8 @@ impl Stat {
9595
use std::os::unix::fs::MetadataExt;
9696
#[cfg(unix)]
9797
let res = Stat {
98-
mtime: mtime.try_into()?,
99-
ctime: ctime.try_into()?,
98+
mtime: mtime.try_into().unwrap_or_default(),
99+
ctime: ctime.try_into().unwrap_or_default(),
100100
// truncating to 32 bits is fine here because
101101
// that's what the linux syscalls returns
102102
// just rust upcasts to 64 bits for some reason?

0 commit comments

Comments
 (0)