bit_refs

Git reference store (gix-ref equivalent)

git
ref
moon add mizchi/bit_refs@0.46.4
Download zip
Author
Version
0.46.4
License
Apache-2.0
Last updated
4 days ago
Downloads
496
README

#
PackedRefEntry

pub(all) struct PackedRefEntry {
refname : String
oid : String
peeled : String?
} derive(Eq,
Debug
)

A single packed-refs entry with its optional peeled (^<oid>) line.

#
collect_loose_ref_ids

fn collect_loose_ref_ids(fs : &
RepoFileSystem
, dir : String, prefix : String, out : Map[String,
ObjectId
], filter_prefix : String?) -> Unit

#
collect_packed_ref_ids

fn collect_packed_ref_ids(fs : &
RepoFileSystem
, git_dir : String, out : Map[String,
ObjectId
], filter_prefix : String?) -> Unit

#
list_refs_with_ids

fn list_refs_with_ids(fs : &
RepoFileSystem
, git_dir : String, filter_prefix : String?) -> Map[String,
ObjectId
]

#
list_remote_tracking_refs

fn list_remote_tracking_refs(fs : &
RepoFileSystem
, git_dir : String, remote_name : String) -> Map[String,
ObjectId
]

#
parse_packed_refs_text

fn parse_packed_refs_text(text : String) -> Array[PackedRefEntry]

Parse packed-refs text into entries. Header (#) and blank lines are dropped; a ^ line is attached to the entry that precedes it.

#
remove_packed_ref

fn remove_packed_ref(fs : &
FileSystem
, rfs : &
RepoFileSystem
, git_dir : String, refname : String) -> Unit raise
GitError

#
remove_packed_refs_with_prefix

fn remove_packed_refs_with_prefix(fs : &
FileSystem
, rfs : &
RepoFileSystem
, git_dir : String, prefix : String, exact : String) -> Unit raise
GitError

#
remove_remote_refs

fn remove_remote_refs(fs : &
FileSystem
, rfs : &
RepoFileSystem
, git_dir : String, name : String) -> Unit

#
rename_packed_refs_prefix

fn rename_packed_refs_prefix(fs : &
FileSystem
, rfs : &
RepoFileSystem
, git_dir : String, old_prefix : String, new_prefix : String, old_exact : String, new_exact : String) -> Unit raise
GitError

#
rewrite_packed_refs

fn rewrite_packed_refs(fs : &
FileSystem
, rfs : &
RepoFileSystem
, git_dir : String, transform : (String) -> String?) -> Unit raise
GitError

#
serialize_packed_refs_entries

fn serialize_packed_refs_entries(entries : Array[PackedRefEntry]) -> String

Serialize entries into canonical packed-refs text: exactly one entry per refname (later duplicates win), sorted by refname, with git's standard header. Every packed-refs write MUST go through this (or produce the same invariants): real git trusts the sorted trait and binary-searches the file, so an unsorted or duplicated file breaks ref resolution in real git.

Source Files

Powered by MoonBit

Site sourceReport issuePackagesBuild queueSkillsStatistics

© 2026 mooncakes.io