package git-unix

  1. Overview
  2. Docs
val mem : t -> Reference.t -> bool Lwt.t

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

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

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) result Lwt.t

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

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) result Lwt.t
val write : t -> Reference.t -> Reference.head_contents -> (unit, error) result Lwt.t

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

OCaml

Innovation. Community. Security.