refname

package
v0.2.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 14, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Package refname validates reference names (branch, tag, HEAD) for both storage backends. Centralizing this logic prevents divergence between the filesystem and memory backends.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsWindowsReservedName

func IsWindowsReservedName(name string) bool

IsWindowsReservedName checks if a name is reserved by Windows and cannot be used as a filename. Covers CON, AUX, NUL, PRN, COM0-9, LPT0-9. The check is case-insensitive, matching Windows filesystem behavior.

func RefType

func RefType(name string) core.RefType

RefType derives the core.RefType from a reference name. "HEAD" maps to RefTypeHead; names prefixed with "heads/" or "tags/" map to RefTypeBranch or RefTypeTag respectively; anything else defaults to RefTypeBranch. This logic is shared by the filesystem and memory backends so both return the same Type for the same name without duplicating the dispatch.

func Validate

func Validate(name string) error

Validate validates a reference name. Returns nil if valid.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL