Expand description
Shared pack-parsing helpers for reading object headers, varints, offsets, and zlib-compressed payloads as defined by Git’s pack format.
Functions§
- calculate_
object_ hash - Calculate the SHA1 hash of the given object.
“<type> <size>\0<content>”
data: The decompressed content of the object - count_
dir_ files - Count the number of files in a directory and its subdirectories.
- create_
empty_ dir - Create an empty directory or clear the existing directory.
- is_eof
- Checks if the reader has reached EOF (end of file).
- read_
byte_ and_ check_ continuation - Reads a byte from the given stream and checks if there are more bytes to continue reading.
- read_
bytes - Read the next N bytes from the reader
- read_
delta_ object_ size - Reads the base size and result size of a delta object from the given stream.
- read_
offset_ encoding - The offset for an OffsetDelta object(big-endian order)
- read_
partial_ int - Reads a partial integer from a stream. (little-endian order)
- read_
type_ and_ varint_ size - Reads bytes from the stream and parses the first byte for type and size. Subsequent bytes are read as size bytes and are processed as variable-length integer in little-endian order. The function returns the type and the computed size.
- read_
varint_ le - Reads a variable-length integer (VarInt) encoded in little-endian format from a source implementing the Read trait.