libgit2

git_reference_name_is_valid

Version:

Ensure the reference name is well-formed.

Valid reference names must follow one of two patterns:

  1. Top-level names must contain only capital letters and underscores, and must begin and end with a letter. (e.g. "HEAD", "ORIG_HEAD").
  2. Names prefixed with "refs/" can be almost anything. You must avoid the characters '~', '^', ':', '
    ', '?', '[', and '*', and the sequences ".." and "@{" which have special meaning to revparse.

Signature

int git_reference_name_is_valid(int *valid, const char *refname);

Parameters

int *
In
valid

output pointer to set with validity of given reference name

const char *
In
refname

name to be checked.

Returns

int

0 on success or an error code

Versions