@@ -95,11 +95,19 @@ mod find_youngest_matching_commit {
9595 fn regex_matches ( ) {
9696 let repo = repo ( "complex_graph" ) . unwrap ( ) ;
9797
98- // On the full linux CI `test` workflow, archived baseline aren't used - instead fixtures will be re-evaluated.
99- // As of Git 2.47, its behaviour changed which makes the following assertion fail.
100- // We decided to just ignore it until it's clear that this isn't a bug - obviously the traversal order changed.
101- let is_in_test_ci_workflow = is_ci:: cached ( ) && std:: env:: var_os ( "GIX_TEST_IGNORE_ARCHIVES" ) . is_some ( ) ;
102- if is_in_test_ci_workflow {
98+ // The full Linux CI `test` job regenerates baselines instead of taking them from archives.
99+ // In Git 2.47.0 (and 2.47.1), the traversal order differs, so some `parse_spec` assertions
100+ // fail. This is a Git bug with a forthcoming fix. For now, we use `parse_spec_no_baseline`
101+ // for them when tests are run that way with known-affected Git versions. For details, see:
102+ //
103+ // - https://lore.kernel.org/git/[email protected] /T/ 104+ // - https://lore.kernel.org/git/[email protected] /T/ 105+ // - https://github.com/GitoxideLabs/gitoxide/issues/1622#issuecomment-2529580735
106+ let skip_some_baselines = is_ci:: cached ( )
107+ && std:: env:: var_os ( "GIX_TEST_IGNORE_ARCHIVES" ) . is_some ( )
108+ && ( ( 2 , 47 , 0 ) ..( 2 , 47 , 2 ) ) . contains ( & gix_testtools:: GIT_VERSION ) ;
109+
110+ if skip_some_baselines {
103111 assert_eq ! (
104112 parse_spec_no_baseline( ":/mes.age" , & repo) . unwrap( ) ,
105113 Spec :: from_id( hex_to_id( "ef80b4b77b167f326351c93284dc0eb00dd54ff4" ) . attach( & repo) )
@@ -116,7 +124,7 @@ mod find_youngest_matching_commit {
116124 "None of 10 commits reached from all references matched regex \" not there\" "
117125 ) ;
118126
119- if is_in_test_ci_workflow {
127+ if skip_some_baselines {
120128 assert_eq ! (
121129 parse_spec_no_baseline( ":/!-message" , & repo) . unwrap( ) ,
122130 Spec :: from_id( hex_to_id( "55e825ebe8fd2ff78cad3826afb696b96b576a7e" ) . attach( & repo) )
0 commit comments