package volgo-base

  1. Overview
  2. Docs

Module Vcs.GitSource

include module type of Volgo.Vcs.Git
Sourcemodule type S = Volgo.Vcs.Git.S

This is the interface commonly used by raising and non-raising helper modules, such as Vcs.Git, Volgo_base.Vcs.Git.Or_error, Vcs.Git.Result, Vcs.Git.Rresult, and custom ones built with Vcs.Git.Non_raising.Make. S is parametrized by the result type returned by the helpers.

The interface exposed at the top level of this module are helpers that return direct results, or raise Err.E. This module is exported to users as Vcs.Git.

The helpers are suitable for use in combination with the Vcs.git function, which will take care of wrapping the exception with useful context, before re-raising it.

include S with type 'a result := 'a
Sourceval exit0 : Volgo__.Git.Output.t -> unit
Sourceval exit0_and_stdout : Volgo__.Git.Output.t -> string
Sourceval exit_code : Volgo__.Git.Output.t -> accept:(int * 'a) list -> 'a

A convenient wrapper to write exhaustive match on a result conditioned by a list of accepted exit codes. If the exit code is not part of the accepted list, the function takes care of returning an error of the expected result type.

Sourcemodule Non_raising = Volgo.Vcs.Git.Non_raising
Sourcemodule Or_error : S with type 'a result := ('a, Base.Error.t) Base.Result.t

Helpers to wrap process outputs.