diff --git a/CHANGES.md b/CHANGES.md index 114cdb747..7e28d2984 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -24,6 +24,9 @@ - Fix a failure when using opam-monorepo with an opam 2.2 root (#379, @kit-ty-kate) +- Fix assertion failure when prefix of "lock" subcommand is used (#381, + @gridbugs) + ### Removed ### Security diff --git a/cli/lock.ml b/cli/lock.ml index 2b03938ce..b4e1f68e1 100644 --- a/cli/lock.ml +++ b/cli/lock.ml @@ -515,7 +515,7 @@ let extract_source_config ~adjustment ~opam_monorepo_cwd ~opam_files let raw_cli_args () = match Array.to_list Sys.argv with - | _bin :: "lock" :: args -> args + | _bin :: prefix :: args when String.starts_with ~prefix "lock" -> args | _ -> assert false let run (`Root root) (`Recurse_opam recurse) (`Build_only build_only)