module FS : sig ... endmodule Hash : sig ... endmodule Deflate : sig ... endmodule Inflate : sig ... endmodule Value : Value.S with module Hash := Hash and module Deflate := Deflate and module Inflate := Inflateinclude module type of Value
type t = | Blob of Blob.t | The |
| Commit of Commit.t | The |
| Tree of Tree.t | The |
| Tag of Tag.t | The |
OCaml value which represents a Git object.
val kind : t -> [ `Commit | `Blob | `Tree | `Tag ]kind o returns the kind of the Git object.
val pp_kind : [ `Commit | `Blob | `Tree | `Tag ] Fmt.tpp_kind ppf kind is a human readable pretty-printer of kind.
module MakeMeta : functor (Meta : Encore.Meta.S) -> sig ... endmodule A : sig ... endmodule M : sig ... endmodule D : sig ... endmodule E : sig ... endval length : t -> int64type error = [ | Error.Decoder.t |
| Inflate.error Error.Inf.t |
| Deflate.error Error.Def.t |
| FS.error Error.FS.t |
]val read : fs:FS.t -> root:Fpath.t -> window:Inflate.window -> ztmp:Cstruct.t -> dtmp:Cstruct.t -> raw:Cstruct.t -> Hash.t -> (t, error) Stdlib.result Lwt.tread ~fs ~root ~window ~ztmp ~dtmp ~raw hash tries to extract from a loose file localized in root / objects a Git object. This function reads (uses raw buffer to read) the file, inflates (uses ztmp and window to inflate) and decodes (uses dtmp to decode) Git object and make a Value.t.
val read_inflated : fs:FS.t -> root:Fpath.t -> window:Inflate.window -> ztmp:Cstruct.t -> dtmp:Cstruct.t -> raw:Cstruct.t -> Hash.t -> (kind * Cstruct.t, error) Stdlib.result Lwt.tread_inflated ~fs ~root ~window ~ztmp ~dtmp ~raw hash tries to extract from a loose file localized in root / objects a Git object. This function reads (uses raw buffer to read) the file, inflates (uses ztmp and window to inflate) and decodes only Git header and body (uses dtmp to decode) Git object and make a fresh buffer.
Body is the serialization of the Git object, and, from kind (kind of Git object), client can call decoder associated to the kind returned (like Tree.Decoder for example).
val read_inflated_without_allocation : fs:FS.t -> root:Fpath.t -> window:Inflate.window -> ztmp:Cstruct.t -> dtmp:Cstruct.t -> raw:Cstruct.t -> result:Cstruct.t -> Hash.t -> (kind * Cstruct.t, error) Stdlib.result Lwt.tread_inflated_without_allocation ~fs ~root ~window ~ztmp ~dtmp ~raw
~result hash is the same as read_inflated. However, instead to make a fresh buffer which will contain the Git object serialized, it uses result to store it. This function does not allocate any buffer.
val size : fs:FS.t -> root:Fpath.t -> window:Inflate.window -> ztmp:Cstruct.t -> dtmp:Cstruct.t -> raw:Cstruct.t -> Hash.t -> (int64, error) Stdlib.result Lwt.t