Monorepo management for opam overlays
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

Fix SPLIT_COMMIT placeholder replacement in fork

The previous replacement logic was broken - it was mangling the string
by splitting on 'S' instead of replacing the literal "SPLIT_COMMIT".

Simplified to a straightforward prefix check and substring replacement.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

+4 -11
+4 -11
lib/fork_join.ml
··· 665 665 (* Replace SPLIT_COMMIT placeholder with actual commit if available *) 666 666 let ref_spec = 667 667 match state.split_commit with 668 - | Some commit -> String.concat "" (String.split_on_char 'S' (String.concat commit (String.split_on_char 'S' ref_spec))) 669 - |> fun s -> if String.starts_with ~prefix:"PLIT_COMMIT" s then 670 - Option.value ~default:ref_spec state.split_commit ^ String.sub s 11 (String.length s - 11) 671 - else s 672 - | None -> ref_spec 673 - in 674 - (* Better replacement: look for SPLIT_COMMIT literal *) 675 - let ref_spec = 676 - match state.split_commit with 677 668 | Some commit -> 678 - if String.length ref_spec >= 12 && String.sub ref_spec 0 12 = "SPLIT_COMMIT" then 679 - commit ^ String.sub ref_spec 12 (String.length ref_spec - 12) 669 + (* Simple string replacement: SPLIT_COMMIT -> actual commit *) 670 + let placeholder = "SPLIT_COMMIT" in 671 + if String.starts_with ~prefix:placeholder ref_spec then 672 + commit ^ String.sub ref_spec (String.length placeholder) (String.length ref_spec - String.length placeholder) 680 673 else ref_spec 681 674 | None -> ref_spec 682 675 in