package git

  1. Overview
  2. Docs
Legend:
Page
Library
Module
Module type
Parameter
Class
Class type
Source

Module Make.ReferenceSource

The Reference module, which represents the Git reference.

include Reference.S with module Hash := Hash
Sourcetype nonrec t = Reference.t
Sourcemodule P : sig ... end
Sourceval head : t
Sourceval master : t
Sourceval is_head : t -> bool
Sourceval of_string : string -> t
Sourceval to_string : t -> string
Sourceval of_path : Path.t -> t
Sourceval to_path : t -> Path.t
Sourceval pp : t Fmt.t
Sourceval compare : t -> t -> int
Sourceval hash : t -> int
Sourceval equal : t -> t -> bool
Sourcemodule Set : Set.S with type elt = t
Sourcemodule Map : Map.S with type key = t
Sourcetype head_contents =
  1. | Hash of Hash.t
    (*

    A pointer to an hash.

    *)
  2. | Ref of t
    (*

    A reference which one can point to an other reference or an hash.

    *)

The type of the value of a Git reference.

Sourceval pp_head_contents : head_contents Fmt.t

Pretty-printer of head_contents.

Sourceval equal_head_contents : head_contents -> head_contents -> bool

equal_head_contents a b implies a = Ref a' and b = Ref b' and Reference.equal a' b' = true or a = Hash a' and b = Hash b' and Hash.equal a' b'.

However, semantically Ref a' could be equal to Hash b' iff Hash b' is come from the reference a'. That means this function does not handle any indirection when it tests your values.

Sourceval compare_head_contents : head_contents -> head_contents -> int
Sourcemodule A : sig ... end
Sourcemodule M : sig ... end
Sourcemodule D : sig ... end
Sourcemodule E : sig ... end

The type of error.

Sourceval pp_error : error Fmt.t

Pretty-printer of error.

Sourceval mem : fs:FS.t -> root:Fpath.t -> t -> bool Lwt.t

mem ~fs ~root reference is true iff reference can be found in the git repository root. Otherwise, it is false.

Sourceval read : fs:FS.t -> root:Fpath.t -> t -> dtmp:Cstruct.t -> raw:Cstruct.t -> (head_contents, error) result Lwt.t

read ~fs ~root reference dtmp raw is the value of the reference reference (available in the git repository root). dtmp and raw are buffers used by the decoder (respectively for the decoder as an internal buffer and the input buffer).

This function can returns an error.

Sourceval write : fs:FS.t -> root:Fpath.t -> temp_dir:Fpath.t -> etmp:Cstruct.t -> raw:Cstruct.t -> t -> head_contents -> (unit, error) result Lwt.t

write ~fs ~root ~raw reference value writes the value value in the mutable representation of the reference in the git repository root. raw is a buffer used by the decoder to keep the input.

This function can returns an error.

Sourceval remove : fs:FS.t -> root:Fpath.t -> t -> (unit, error) result Lwt.t

remove ~root reference removes the reference from the git repository root.

This function can returns an error.