123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475(*******************************************************************************)(* Volgo - a Versatile OCaml Library for Git Operations *)(* Copyright (C) 2024-2025 Mathieu Barbin <mathieu.barbin@gmail.com> *)(* *)(* This file is part of Volgo. *)(* *)(* Volgo is free software; you can redistribute it and/or modify it under *)(* the terms of the GNU Lesser General Public License as published by the *)(* Free Software Foundation either version 3 of the License, or any later *)(* version, with the LGPL-3.0 Linking Exception. *)(* *)(* Volgo is distributed in the hope that it will be useful, but WITHOUT ANY *)(* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS *)(* FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License and *)(* the file `NOTICE.md` at the root of this repository for more details. *)(* *)(* You should have received a copy of the GNU Lesser General Public License *)(* and the LGPL-3.0 Linking Exception along with this library. If not, see *)(* <http://www.gnu.org/licenses/> and <https://spdx.org>, respectively. *)(*******************************************************************************)[@@@coverageoff]typet={remote_name:Remote_name.t;branch_name:Branch_name.t}letto_dyn{remote_name;branch_name}=Dyn.record["remote_name",Remote_name.to_dynremote_name;"branch_name",Branch_name.to_dynbranch_name];;letsexp_of_tt=Dyn.to_sexp(to_dynt)letcomparet({remote_name;branch_name}ast2)=ifphys_equaltt2then0else(matchRemote_name.comparet.remote_nameremote_namewith|0->Branch_name.comparet.branch_namebranch_name|n->n);;letequalab=compareab=0[@@@coverageon]letseeded_hash=(Hashtbl.seeded_hash:int->t->int)lethash=(Hashtbl.hash:t->int)letto_string{remote_name;branch_name}=Printf.sprintf"%s/%s"(Remote_name.to_stringremote_name)(Branch_name.to_stringbranch_name);;letof_stringstr=matchString.lsplit2str~on:'/'with|None->Error(`Msg(Printf.sprintf"%S: invalid remote_branch_name"str))|Some(remote,branch)->letopenResult.Syntaxinlet*remote_name=Remote_name.of_stringremoteinlet*branch_name=Branch_name.of_stringbranchinResult.return{remote_name;branch_name};;letvstr=matchstr|>of_stringwith|Okt->t|Error(`Msgm)->invalid_argm;;