Skip to main content

Module refs

Module refs 

Source
Expand description

Git-style refs for branches and HEAD.

HEAD can be:

  • Symbolic: ref: refs/heads/trunk (pointing to a branch)
  • Detached: raw CID string (pointing directly to a commit)

Branch refs are stored in .void/refs/heads/<name> as raw CID strings.

Enums§

HeadRef
HEAD reference - either symbolic (pointing to a branch) or detached (direct CID).

Functions§

delete_branch
Delete a branch ref.
delete_tag
Delete a tag ref.
list_branches
List all branch names.
list_tags
List all tag names.
read_branch
Read a branch ref. Returns None if branch doesn’t exist.
read_head
Read HEAD, returns None if HEAD doesn’t exist.
read_push_marker
Read the last-pushed commit CID for a backend. Returns None if no marker exists.
read_tag
Read a tag ref. Returns None if tag doesn’t exist.
resolve_head
Resolve HEAD to a CID (follows symbolic ref if needed). Returns None if HEAD doesn’t exist or points to non-existent branch.
resolve_head_split
Resolve HEAD to a CID with split directories for workspaces.
write_branch
Write a branch ref.
write_head
Write HEAD (symbolic or detached).
write_push_marker
Write the last-pushed commit CID for a backend.
write_tag
Write a tag ref.