@@ -186,9 +186,9 @@ mod multiple {
186186}
187187
188188mod complex_globs {
189- use gix_refspec:: { parse:: Operation , MatchGroup } ;
190- use gix_hash:: ObjectId ;
191189 use bstr:: BString ;
190+ use gix_hash:: ObjectId ;
191+ use gix_refspec:: { parse:: Operation , MatchGroup } ;
192192 use std:: borrow:: Cow ;
193193
194194 #[ test]
@@ -197,18 +197,21 @@ mod complex_globs {
197197 // can now be parsed for one-sided refspecs
198198 let spec1 = gix_refspec:: parse ( "refs/*/foo/*" . into ( ) , Operation :: Fetch ) ;
199199 assert ! ( spec1. is_ok( ) , "Should parse complex glob pattern for one-sided refspec" ) ;
200-
200+
201201 let spec2 = gix_refspec:: parse ( "refs/*/*/bar" . into ( ) , Operation :: Fetch ) ;
202- assert ! ( spec2. is_ok( ) , "Should parse complex glob pattern with multiple asterisks" ) ;
203-
202+ assert ! (
203+ spec2. is_ok( ) ,
204+ "Should parse complex glob pattern with multiple asterisks"
205+ ) ;
206+
204207 let spec3 = gix_refspec:: parse ( "refs/heads/*/release/*" . into ( ) , Operation :: Fetch ) ;
205208 assert ! ( spec3. is_ok( ) , "Should parse complex glob pattern" ) ;
206-
209+
207210 // Two-sided refspecs with multiple asterisks should still fail
208211 let spec4 = gix_refspec:: parse ( "refs/*/foo/*:refs/remotes/*" . into ( ) , Operation :: Fetch ) ;
209212 assert ! ( spec4. is_err( ) , "Two-sided refspecs with multiple asterisks should fail" ) ;
210213 }
211-
214+
212215 #[ test]
213216 fn one_sided_simple_glob_patterns_match ( ) {
214217 // Test that simple glob patterns (one asterisk) work correctly with matching
@@ -219,25 +222,25 @@ mod complex_globs {
219222 create_ref( "refs/pull/123" , "4444444444444444444444444444444444444444" ) ,
220223 ] ;
221224 let items: Vec < _ > = refs. iter ( ) . map ( |r| r. to_item ( ) ) . collect ( ) ;
222-
225+
223226 // Test: refs/heads/* should match all refs under refs/heads/
224227 let spec = gix_refspec:: parse ( "refs/heads/*" . into ( ) , Operation :: Fetch ) . unwrap ( ) ;
225228 let group = MatchGroup :: from_fetch_specs ( [ spec] ) ;
226229 let outcome = group. match_lhs ( items. iter ( ) . copied ( ) ) ;
227230 let mappings = outcome. mappings ;
228-
231+
229232 assert_eq ! ( mappings. len( ) , 2 , "Should match two refs under refs/heads/" ) ;
230-
233+
231234 // Test: refs/tags/* should match all refs under refs/tags/
232235 let items2: Vec < _ > = refs. iter ( ) . map ( |r| r. to_item ( ) ) . collect ( ) ;
233236 let spec2 = gix_refspec:: parse ( "refs/tags/*" . into ( ) , Operation :: Fetch ) . unwrap ( ) ;
234237 let group2 = MatchGroup :: from_fetch_specs ( [ spec2] ) ;
235238 let outcome2 = group2. match_lhs ( items2. iter ( ) . copied ( ) ) ;
236239 let mappings2 = outcome2. mappings ;
237-
240+
238241 assert_eq ! ( mappings2. len( ) , 1 , "Should match one ref under refs/tags/" ) ;
239242 }
240-
243+
241244 #[ test]
242245 fn one_sided_glob_with_suffix_matches ( ) {
243246 // Test that glob patterns with suffix work correctly
@@ -247,16 +250,16 @@ mod complex_globs {
247250 create_ref( "refs/heads/main" , "3333333333333333333333333333333333333333" ) ,
248251 ] ;
249252 let items: Vec < _ > = refs. iter ( ) . map ( |r| r. to_item ( ) ) . collect ( ) ;
250-
253+
251254 // Test: refs/heads/feat* should match refs/heads/feature and refs/heads/feat
252255 let spec = gix_refspec:: parse ( "refs/heads/feat*" . into ( ) , Operation :: Fetch ) . unwrap ( ) ;
253256 let group = MatchGroup :: from_fetch_specs ( [ spec] ) ;
254257 let outcome = group. match_lhs ( items. iter ( ) . copied ( ) ) ;
255258 let mappings = outcome. mappings ;
256-
259+
257260 assert_eq ! ( mappings. len( ) , 2 , "Should match two refs starting with feat" ) ;
258261 }
259-
262+
260263 // Helper function to create a ref
261264 fn create_ref ( name : & str , id_hex : & str ) -> Ref {
262265 Ref {
@@ -265,14 +268,14 @@ mod complex_globs {
265268 object : None ,
266269 }
267270 }
268-
271+
269272 #[ derive( Debug , Clone ) ]
270273 struct Ref {
271274 name : BString ,
272275 target : ObjectId ,
273276 object : Option < ObjectId > ,
274277 }
275-
278+
276279 impl Ref {
277280 fn to_item ( & self ) -> gix_refspec:: match_group:: Item < ' _ > {
278281 gix_refspec:: match_group:: Item {
0 commit comments