Skip to contents

A version is "vN", or NULL where the caller allows it to mean HEAD.

Usage

rfp_mergin_chk_version(version, allow_null = FALSE, arg = "version")

Arguments

version

Character "vN", or NULL.

allow_null

Logical. Is NULL (meaning HEAD) acceptable?

arg

Character. Argument name for the error message.

Value

invisible(version), or an error.

Details

One implementation, because there is more than one caller and two copies of a rule drift silently (#268). It is also the guard that has to fire, rather than a nicety: chk::chk_string("") passes, and the mergin client tests the version with if version: before sending it, so an EMPTY STRING is falsy, never reaches the server, and comes back as HEAD (#265). A pin read from a blank cell would resolve to "whatever is current" - a pin that silently is not a pin, which is the whole failure this subsystem is being fixed for.

"v0" is deliberately allowed. It is a valid shape and the server answers it honestly with an empty listing, so nothing is being invented; and the same rule is what rfp_mergin_changeset() has always applied, so tightening it here would quietly narrow a shipped function.