@@ -48,7 +48,7 @@ fn dirwalk_api_and_icase_support() {
4848 last_pos += 1 ;
4949
5050 let entry = file
51- . entry_closest_to_directory ( dir)
51+ . entry_closest_to_directory_or_directory ( dir)
5252 . unwrap_or_else ( || panic ! ( "didn't find {dir}" ) ) ;
5353 assert ! (
5454 entry. path( & file) . starts_with( dir) ,
@@ -57,69 +57,70 @@ fn dirwalk_api_and_icase_support() {
5757
5858 let dir_upper: BString = dir. to_ascii_uppercase ( ) . into ( ) ;
5959 let other_entry = file
60- . entry_closest_to_directory_icase ( dir_upper. as_bstr ( ) , true , & icase)
60+ . entry_closest_to_directory_or_directory_icase ( dir_upper. as_bstr ( ) , true , & icase)
6161 . unwrap_or_else ( || panic ! ( "didn't find upper-cased {dir_upper}" ) ) ;
6262 assert_eq ! ( other_entry, entry, "the first entry is always the same, no matter what kind of search is conducted (as there are no clashes/ambiguities here)" ) ;
6363 }
6464 }
6565}
6666
6767#[ test]
68- fn entry_closest_to_directory_with_submodule ( ) {
69- let file = Fixture :: Generated ( "V2_all_file_kinds " ) . open ( ) ;
68+ fn entry_closest_to_directory_or_directory_with_submodule ( ) {
69+ let file = Fixture :: Generated ( "v2_all_file_kinds " ) . open ( ) ;
7070
7171 assert ! (
72- file. entry_closest_to_directory ( "d" . into( ) ) . is_some( ) ,
72+ file. entry_closest_to_directory_or_directory ( "d" . into( ) ) . is_some( ) ,
7373 "this is a directory"
7474 ) ;
7575 assert ! (
76- file. entry_closest_to_directory ( "sub" . into( ) ) . is_some( ) ,
76+ file. entry_closest_to_directory_or_directory ( "sub" . into( ) ) . is_some( ) ,
7777 "this is a checked in repository, a directory itself"
7878 ) ;
7979 assert ! (
80- file. entry_closest_to_directory( "sub-worktree" . into( ) ) . is_some( ) ,
80+ file. entry_closest_to_directory_or_directory( "sub-worktree" . into( ) )
81+ . is_some( ) ,
8182 "a submodule that is officially registered, absolutely the same as 'sub' in the index."
8283 ) ;
8384 assert ! (
84- file. entry_closest_to_directory ( "a" . into( ) ) . is_none( ) ,
85+ file. entry_closest_to_directory_or_directory ( "a" . into( ) ) . is_none( ) ,
8586 "'a' is a file, and we ask for a directory"
8687 ) ;
8788}
8889
8990#[ test]
90- fn entry_closest_to_directory_icase_with_submodule ( ) {
91- let file = Fixture :: Generated ( "V2_all_file_kinds " ) . open ( ) ;
91+ fn entry_closest_to_directory_or_directory_icase_with_submodule ( ) {
92+ let file = Fixture :: Generated ( "v2_all_file_kinds " ) . open ( ) ;
9293 let icase = file. prepare_icase_backing ( ) ;
9394
9495 assert ! (
95- file. entry_closest_to_directory_icase ( "D" . into( ) , true , & icase)
96+ file. entry_closest_to_directory_or_directory_icase ( "D" . into( ) , true , & icase)
9697 . is_some( ) ,
9798 "this is a directory"
9899 ) ;
99100 assert ! ( file
100- . entry_closest_to_directory_icase ( "D" . into( ) , false , & icase)
101+ . entry_closest_to_directory_or_directory_icase ( "D" . into( ) , false , & icase)
101102 . is_none( ) ) ;
102103
103104 assert ! (
104- file. entry_closest_to_directory_icase ( "SuB" . into( ) , true , & icase)
105+ file. entry_closest_to_directory_or_directory_icase ( "SuB" . into( ) , true , & icase)
105106 . is_some( ) ,
106107 "this is a checked in repository, a directory itself"
107108 ) ;
108109 assert ! ( file
109- . entry_closest_to_directory_icase ( "SuB" . into( ) , false , & icase)
110+ . entry_closest_to_directory_or_directory_icase ( "SuB" . into( ) , false , & icase)
110111 . is_none( ) ) ;
111112
112113 assert ! (
113- file. entry_closest_to_directory_icase ( "SUB-worktree" . into( ) , true , & icase)
114+ file. entry_closest_to_directory_or_directory_icase ( "SUB-worktree" . into( ) , true , & icase)
114115 . is_some( ) ,
115116 "a submodule that is officially registered, absolutely the same as 'sub' in the index."
116117 ) ;
117118 assert ! ( file
118- . entry_closest_to_directory_icase ( "SUB-worktree" . into( ) , false , & icase)
119+ . entry_closest_to_directory_or_directory_icase ( "SUB-worktree" . into( ) , false , & icase)
119120 . is_none( ) ) ;
120121
121122 assert ! (
122- file. entry_closest_to_directory_icase ( "A" . into( ) , true , & icase)
123+ file. entry_closest_to_directory_or_directory_icase ( "A" . into( ) , true , & icase)
123124 . is_none( ) ,
124125 "'a' is a file, and we ask for a directory"
125126 ) ;
@@ -146,7 +147,7 @@ fn ignorecase_clashes_and_order() {
146147 last_pos += 1 ;
147148
148149 let entry = file
149- . entry_closest_to_directory ( dir)
150+ . entry_closest_to_directory_or_directory ( dir)
150151 . unwrap_or_else ( || panic ! ( "didn't find {dir}" ) ) ;
151152 assert ! (
152153 entry. path( & file) . starts_with( dir) ,
@@ -171,16 +172,16 @@ fn ignorecase_clashes_and_order() {
171172 ) ;
172173
173174 assert ! (
174- file. entry_closest_to_directory ( "d" . into( ) ) . is_none( ) ,
175+ file. entry_closest_to_directory_or_directory ( "d" . into( ) ) . is_none( ) ,
175176 "this is a file, and this directory search isn't case-sensitive"
176177 ) ;
177- let entry = file. entry_closest_to_directory ( "D" . into ( ) ) ;
178+ let entry = file. entry_closest_to_directory_or_directory ( "D" . into ( ) ) ;
178179 assert_eq ! (
179180 entry. map( |e| e. path( & file) ) . expect( "present" ) ,
180181 "D/B" ,
181182 "this is a directory, indeed, we find the first file in it"
182183 ) ;
183- let entry_icase = file. entry_closest_to_directory_icase ( "d" . into ( ) , true , & icase) ;
184+ let entry_icase = file. entry_closest_to_directory_or_directory_icase ( "d" . into ( ) , true , & icase) ;
184185 assert_eq ! (
185186 entry_icase, entry,
186187 "case-insensitive searches don't confuse directories and files, so `d` finds `D`, the directory."
@@ -388,7 +389,7 @@ fn check_prefix(index: &gix_index::State, prefix: &str, expected: &[&str]) {
388389
389390#[ test]
390391fn path_is_directory_with_submodule ( ) {
391- let file = Fixture :: Generated ( "V2_all_file_kinds " ) . open ( ) ;
392+ let file = Fixture :: Generated ( "v2_all_file_kinds " ) . open ( ) ;
392393
393394 assert ! ( file. path_is_directory( "sub-worktree" . into( ) ) , "a submodule worktree" ) ;
394395 assert ! ( file. path_is_directory( "d" . into( ) ) , "a single-letter directory" ) ;
@@ -491,7 +492,7 @@ fn path_is_directory_icase() {
491492
492493#[ test]
493494fn path_is_directory_icase_with_submodule ( ) {
494- let file = Fixture :: Generated ( "V2_all_file_kinds " ) . open ( ) ;
495+ let file = Fixture :: Generated ( "v2_all_file_kinds " ) . open ( ) ;
495496 let icase = file. prepare_icase_backing ( ) ;
496497
497498 assert ! (
0 commit comments