package git

  1. Overview
  2. Docs

Git values

Loose objects.

type t =
  1. | Blob of Blob.t
  2. | Commit of Commit.t
  3. | Tag of Tag.t
  4. | Tree of Tree.t

The type for loose Git objects.

include S with type t := t
val equal : t -> t -> bool

Are two objects equal?

val hash : t -> int

Hash an object.

val compare : t -> t -> int

Compare two objects.

val pp : t Fmt.t

pp is the pretty-printer for values of type t.

val type_of : t -> Object_type.t

Return the object type.

val type_of_inflated : Mstruct.t -> Object_type.t

Return the type of the inflated object stored in the given buffer.

Constructors

val commit : Commit.t -> t

Cast a commit to an object.

val blob : Blob.t -> t

Cast a blob to an object.

val tree : Tree.t -> t

Cast a tree to an object.

val tag : Tag.t -> t

Cast a tag to an object.

IO types

type read = Hash.t -> t option Lwt.t

The type for functions reading values.

type read_inflated = Hash.t -> string option Lwt.t

The type for functions reading inflated values.

type write = t -> Hash.t Lwt.t

The type for functions writing values.

type write_inflated = string -> Hash.t Lwt.t

The type for functions writing raw values.

module Cache : sig ... end
module type IO = sig ... end
module IO (D : Hash.DIGEST) (I : Inflate.S) : IO