@@ -15,7 +15,7 @@ fn in_cwd_upwards_from_nested_dir() -> gix_testtools::Result {
15
15
repo_path. kind( ) ,
16
16
gix_discover:: repository:: Kind :: WorkTree { linked_git_dir: None } ,
17
17
) ;
18
- assert_eq ! ( repo_path. as_ref( ) , Path :: new( "." ) ) ;
18
+ assert_eq ! ( repo_path. as_ref( ) , Path :: new( "." ) , "{dir}" ) ;
19
19
}
20
20
Ok ( ( ) )
21
21
}
@@ -76,9 +76,10 @@ fn upwards_with_relative_directories_and_optional_ceiling() -> gix_testtools::Re
76
76
( "./././very/deeply/nested/subdir" , ".." ) ,
77
77
( "very/deeply/nested/subdir" , ".." ) ,
78
78
] {
79
+ let search_dir = Path :: new ( search_dir) ;
79
80
let ceiling_dir = cwd. join ( ceiling_dir_component) ;
80
81
let ( repo_path, _trust) = gix_discover:: upwards_opts (
81
- search_dir. as_ref ( ) ,
82
+ search_dir,
82
83
Options {
83
84
ceiling_dirs : vec ! [ ceiling_dir] ,
84
85
..Default :: default ( )
@@ -87,12 +88,12 @@ fn upwards_with_relative_directories_and_optional_ceiling() -> gix_testtools::Re
87
88
. expect ( "ceiling dir should allow us to discover the repo" ) ;
88
89
assert_repo_is_current_workdir ( repo_path, Path :: new ( ".." ) ) ;
89
90
90
- let ( repo_path, _trust) = gix_discover :: upwards_opts ( search_dir . as_ref ( ) , Default :: default ( ) )
91
- . expect ( "without ceiling dir we see the same" ) ;
91
+ let ( repo_path, _trust) =
92
+ gix_discover :: upwards_opts ( search_dir , Default :: default ( ) ) . expect ( "without ceiling dir we see the same" ) ;
92
93
assert_repo_is_current_workdir ( repo_path, Path :: new ( ".." ) ) ;
93
94
94
95
let ( repo_path, _trust) = gix_discover:: upwards_opts (
95
- search_dir. as_ref ( ) ,
96
+ search_dir,
96
97
Options {
97
98
ceiling_dirs : vec ! [ PathBuf :: from( ".." ) ] ,
98
99
..Default :: default ( )
@@ -102,17 +103,15 @@ fn upwards_with_relative_directories_and_optional_ceiling() -> gix_testtools::Re
102
103
assert_repo_is_current_workdir ( repo_path, Path :: new ( ".." ) ) ;
103
104
104
105
let err = gix_discover:: upwards_opts (
105
- search_dir. as_ref ( ) ,
106
+ search_dir,
106
107
Options {
107
108
ceiling_dirs : vec ! [ PathBuf :: from( "." ) ] ,
108
109
..Default :: default ( )
109
110
} ,
110
111
)
111
112
. unwrap_err ( ) ;
112
113
113
- if Path :: new ( search_dir) . parent ( ) == Some ( Path :: new ( "." ) )
114
- || Path :: new ( search_dir) . parent ( ) == Some ( Path :: new ( "" ) )
115
- {
114
+ if search_dir. parent ( ) == Some ( "." . as_ref ( ) ) || search_dir. parent ( ) == Some ( "" . as_ref ( ) ) {
116
115
assert ! ( matches!( err, gix_discover:: upwards:: Error :: NoMatchingCeilingDir ) ) ;
117
116
} else {
118
117
assert ! ( matches!(
0 commit comments