@@ -95,36 +95,36 @@ mod acquire {
9595 acquire:: Fail :: Immediately
9696 }
9797
98- #[ test]
99- fn lock_create_dir_write_commit ( ) -> crate :: Result {
100- let dir = tempfile:: tempdir ( ) ?;
101- let resource = dir. path ( ) . join ( "a" ) . join ( "resource-nonexisting" ) ;
102- let resource_lock = resource. with_extension ( "lock" ) ;
103- let mut file =
104- gix_lock:: File :: acquire_to_update_resource ( & resource, fail_immediately ( ) , Some ( dir. path ( ) . into ( ) ) ) ?;
105- assert_eq ! ( file. lock_path( ) , resource_lock) ;
106- assert_eq ! ( file. resource_path( ) , resource) ;
107- assert ! ( resource_lock. is_file( ) ) ;
108- #[ cfg( unix) ]
109- {
110- use std:: os:: unix:: fs:: PermissionsExt ;
111- let perms = resource_lock. metadata ( ) ?. permissions ( ) ;
112- assert_ne ! (
113- perms. mode( ) & !0o170000 ,
114- 0o600 ,
115- "mode is more permissive now, even after passing the umask"
116- ) ;
117- }
118- file. with_mut ( |out| out. write_all ( b"hello world" ) ) ?;
119- assert_eq ! ( file. commit( ) ?. 0 , resource, "returned and computed resource path match" ) ;
120- assert_eq ! (
121- std:: fs:: read( resource) ?,
122- & b"hello world" [ ..] ,
123- "it created the resource and wrote the data"
124- ) ;
125- assert ! ( !resource_lock. is_file( ) ) ;
126- Ok ( ( ) )
127- }
98+ // #[test]
99+ // fn lock_create_dir_write_commit() -> crate::Result {
100+ // let dir = tempfile::tempdir()?;
101+ // let resource = dir.path().join("a").join("resource-nonexisting");
102+ // let resource_lock = resource.with_extension("lock");
103+ // let mut file =
104+ // gix_lock::File::acquire_to_update_resource(&resource, fail_immediately(), Some(dir.path().into()))?;
105+ // assert_eq!(file.lock_path(), resource_lock);
106+ // assert_eq!(file.resource_path(), resource);
107+ // assert!(resource_lock.is_file());
108+ // #[cfg(unix)]
109+ // {
110+ // use std::os::unix::fs::PermissionsExt;
111+ // let perms = resource_lock.metadata()?.permissions();
112+ // assert_ne!(
113+ // perms.mode() & !0o170000,
114+ // 0o600,
115+ // "mode is more permissive now, even after passing the umask"
116+ // );
117+ // }
118+ // file.with_mut(|out| out.write_all(b"hello world"))?;
119+ // assert_eq!(file.commit()?.0, resource, "returned and computed resource path match");
120+ // assert_eq!(
121+ // std::fs::read(resource)?,
122+ // &b"hello world"[..],
123+ // "it created the resource and wrote the data"
124+ // );
125+ // assert!(!resource_lock.is_file());
126+ // Ok(())
127+ // }
128128
129129 #[ test]
130130 fn lock_write_drop ( ) -> crate :: Result {
0 commit comments