123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172(*******************************************************************************)(* 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=|Local_branchof{branch_name:Branch_name.t}|Remote_branchof{remote_branch_name:Remote_branch_name.t}|Tagof{tag_name:Tag_name.t}|Otherof{name:string}letto_dyn=function|Local_branch{branch_name}->Dyn.inline_record"Local_branch"["branch_name",Branch_name.to_dynbranch_name]|Remote_branch{remote_branch_name}->Dyn.inline_record"Remote_branch"["remote_branch_name",Remote_branch_name.to_dynremote_branch_name]|Tag{tag_name}->Dyn.inline_record"Tag"["tag_name",Tag_name.to_dyntag_name]|Other{name}->Dyn.inline_record"Other"["name",Dyn.stringname];;letsexp_of_tt=Dyn.to_sexp(to_dynt)letcompareab=ifphys_equalabthen0else(matcha,bwith|Local_brancha,Local_branch{branch_name}->Branch_name.comparea.branch_namebranch_name|Local_branch_,_->-1|_,Local_branch_->1|Remote_brancha,Remote_branch{remote_branch_name}->Remote_branch_name.comparea.remote_branch_nameremote_branch_name|Remote_branch_,_->-1|_,Remote_branch_->1|Taga,Tag{tag_name}->Tag_name.comparea.tag_nametag_name|Tag_,_->-1|_,Tag_->1|Othera,Other{name}->String.comparea.namename);;letequalab=compareab=0letseeded_hash=(Hashtbl.seeded_hash:int->t->int)lethash=(Hashtbl.hash:t->int)letto_string=function|Local_branch{branch_name}->"refs/heads/"^Branch_name.to_stringbranch_name|Remote_branch{remote_branch_name}->"refs/remotes/"^Remote_branch_name.to_stringremote_branch_name|Tag{tag_name}->"refs/tags/"^Tag_name.to_stringtag_name|Other{name}->"refs/"^name;;