File tree Expand file tree Collapse file tree 4 files changed +27
-0
lines changed Expand file tree Collapse file tree 4 files changed +27
-0
lines changed Original file line number Diff line number Diff line change
1
+ #! /bin/bash
2
+ set -eu -o pipefail
3
+
4
+ # The largest-possible date for Ext4, nanos are special there, but ont usually on other filesystems
5
+ touch -d " 2446-05-10 22:38:55.111111111" future
6
+ # The smallest-possible date for Ext4, nanos are special there, but ont usually on other filesystems
7
+ touch -d " 1901-12-13 20:45:52.222222222" past
Original file line number Diff line number Diff line change
1
+ file_metadata.tar.xz
Original file line number Diff line number Diff line change
1
+ mod metadata {
2
+ use gix_index:: fs:: Metadata ;
3
+
4
+ #[ test]
5
+ fn from_path_no_follow ( ) -> crate :: Result {
6
+ let root = gix_testtools:: scripted_fixture_read_only_standalone ( "file_metadata.sh" ) ?;
7
+
8
+ // For now, don't assert on the values of the metadata as these depends on the filesystem,
9
+ // which might truncate it, or fail entirely.
10
+ for filename in [ "future" , "past" ] {
11
+ let meta = Metadata :: from_path_no_follow ( & root. join ( filename) ) ?;
12
+ assert ! ( meta. created( ) . is_some( ) ) ;
13
+ assert ! ( meta. modified( ) . is_some( ) ) ;
14
+ assert_eq ! ( meta. len( ) , 0 ) ;
15
+ }
16
+ Ok ( ( ) )
17
+ }
18
+ }
Original file line number Diff line number Diff line change @@ -5,6 +5,7 @@ use gix_hash::ObjectId;
5
5
mod access;
6
6
mod entry;
7
7
mod file;
8
+ mod fs;
8
9
mod init;
9
10
10
11
pub fn hex_to_id ( hex : & str ) -> ObjectId {
You can’t perform that action at this time.
0 commit comments