is_ref: Checks whether the supplied object is a valid reference name

Description Usage Arguments Details Value

View source: R/utilities.R

Description

A valid reference has restrictions on the special characters allowed (see details).

Usage

1
is_ref(x)

Arguments

x

Object to check

Details

Git imposes the following rules when naming references:

  1. They can include slash / for hierarchical (directory) grouping, but no slash-separated component can begin with a dot . or dash - or end with the sequence .lock.

  2. They cannot have two consecutive dots .. anywhere.

  3. They cannot have the special characters: space , tilde ~, caret ^, or colon :, question-mark ?, asterisk *, backslash \\, or open bracket \[ anywhere.

  4. They cannot begin or end with a slash / or contain multiple consecutive slashes

  5. They cannot end with a dot ..

  6. They cannot contain a sequence @\{.

  7. They cannot be the single character @.

Value

TRUE if x is a valid reference name, FALSE otherwise


ChadGoymer/githapi documentation built on Oct. 22, 2021, 10:56 a.m.