API Reference

Git Components

class index
class workspace
class refs
using sha1_digest = std::array<std::byte, 20>

A SHA-1 Digest expressed as an array of bytes

Database

class author

Special Members

author(std::string name, std::string email, std::time_t time)

Public Functions

friend std::string to_string(author const&)

Formats the author to a string in the format:

<name> \<<email>\> <unix timestamp> <UTC offset>

class blob

Special Members

blob(std::string contents)

Public Functions

friend std::string to_string(blob const&)

Formats the blob to a string in the format:

<contents>

sha1_digest const &oid() const

Get the object ID of the blob

class commit

Represents a Git Commit

Special Members

commit(tl::optional<sha1_digest> const &parent, sha1_digest const &tree_oid, author auth, std::string message)

Public Functions

std::string_view type() const

The database object type, which is “commit”

class database

Represents a Git Database

class tree

Represents a Git Tree

class lockfile

Represents a Git Lockfile

Special Members

lockfile(fs::path path, bool binary_mode = false)
~lockfile()

Commit the changes made to the locked file

Public Functions

void abort()

Unlock the file and discard any changes written

void write(std::string_view)
template<std::size_t N>
void write(std::array<std::byte, N> const&)

Write the given data to the lockfile

Utilities

Filesystem

Format

Functional

Hash

Binary