libgit2

git_branch_name_is_valid

Version:

Determine whether a branch name is valid, meaning that (when prefixed with refs/heads/) that it is a valid reference name, and that any additional branch name restrictions are imposed (eg, it cannot start with a -).

Signature

int git_branch_name_is_valid(int *valid, const char *name);

Parameters

int *
In
valid

output pointer to set with validity of given branch name

const char *
In
name

a branch name to test

Returns

int

0 on success or an error code

Versions