module P : sig ... end
val head : t
head
is the user-friendly value of HEAD Git reference.
val master : t
master
is the user-friendly value of refs/heads/master
Git reference.
val is_head : t -> bool
is_head t
returns true
if t = head
.
val of_string : string -> t
of_string s
returns a valid reference value. A valid value means:
A refname
is a hierarchical octet string beginning with "refs/"
and not violating the git-check-ref-format
command's validation rules. More specifically, they:
- They can include slash
'/'
for hierarchical (directory) grouping, but no slash-separated component can begin with a dot'.'
. - They must contain at least one
'/'
. This enforces the presence of a category like"heads/"
,"tags/"
etc. but the actual names are not restricted. - They cannot have two consecutive dots
".."
anywhere. - They cannot have ASCII control characters (i.e. bytes whose values are lower than
\040
or\177
DEL), space, tilde'~'
, caret'^'
, colon':'
, question-mark'?'
, asterisk'*'
, or open bracket'['
anywhere. - They cannot end with a slash
'/'
or a dot'.'
. - They cannot end with the sequence
".lock"
. - They cannot contain a sequence
"@{"
. - They cannot contain a
'\\'
.
val to_string : t -> string
to_string t
returns the string value of the reference t
.
to_path ref
casts a reference ref
to a path (as a Window path or Unix path).
module type S = sig ... end
Interface to describe the Git reference value head_contents
.
module type IO = sig ... end
The interface which describes any I/O operations on Git reference.
The functor to make the OCaml representation of the Git Reference object by a specific hash.