File tree Expand file tree Collapse file tree 1 file changed +8
-2
lines changed
pgvectorscale/src/access_method Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -55,8 +55,14 @@ pub mod tests {
5555
5656 // Convert the file path to an absolute path
5757 let current_dir = std:: env:: current_dir ( ) . unwrap ( ) ;
58- let mut absolute_path = std:: path:: Path :: new ( & current_dir) . join ( current_file) ;
59- absolute_path = absolute_path. ancestors ( ) . nth ( 4 ) . unwrap ( ) . to_path_buf ( ) ;
58+ let absolute_path_full = std:: path:: Path :: new ( & current_dir) . join ( current_file) ;
59+ let mut absolute_path = None ;
60+ for ancestor in absolute_path_full. ancestors ( ) {
61+ if std:: fs:: exists ( ancestor. join ( ".git" ) ) . unwrap ( ) {
62+ absolute_path = Some ( ancestor. to_path_buf ( ) ) ;
63+ }
64+ }
65+ let absolute_path = absolute_path. expect ( "Couldn't find root directory" ) ;
6066
6167 let temp_dir = tempfile:: tempdir ( ) . unwrap ( ) ;
6268 let temp_path = temp_dir. path ( ) ;
You can’t perform that action at this time.
0 commit comments