package git

  1. Overview
  2. Docs
Legend:
Library
Module
Module type
Parameter
Class
Class type
val mem : t -> Reference.t -> bool Lwt.t

mem state ref is true iff ref exists in state, otherwise it is false.

val graph : t -> (Hash.t Reference.Map.t, error) Stdlib.result Lwt.t

graph state is the graph containing all the references and their relationship in the current git repository state.

val normalize : Hash.t Reference.Map.t -> Reference.head_contents -> (Hash.t, error) Stdlib.result Lwt.t

normalize graph ref is the final hash pointed by the reference ref. This function can return an error:

  • `Invalid_reference ref if, from the graph graph, we don't find the final pointed hash. This case can appear if the graph is not complete or if the link is broken.
val list : t -> (Reference.t * Hash.t) list Lwt.t

list state is the list of references and their associated hash. This function is the same than:

> graph state >|= Reference.Map.fold (fun x acc -> x :: acc)

Finally, as for graph, if we encountered any error, we make it silent and continue the process.

val remove : t -> Reference.t -> (unit, error) Stdlib.result Lwt.t

remove state reference removes the reference reference from the git repository state.

val read : t -> Reference.t -> (Reference.head_contents, error) Stdlib.result Lwt.t

read state reference is the value contained in the reference reference (available in the git repository state).

val resolve : t -> Reference.t -> (Hash.t, error) Stdlib.result Lwt.t
val write : t -> Reference.t -> Reference.head_contents -> (unit, error) Stdlib.result Lwt.t

write state reference value writes the value value in the the reference in the git repository state.

OCaml

Innovation. Community. Security.