Nix 2.26.3
Nix, the purely functional package manager; unstable internal interfaces
 
Loading...
Searching...
No Matches
nix::GitRepoImpl Struct Reference
Inheritance diagram for nix::GitRepoImpl:
nix::GitRepo

Public Member Functions

 GitRepoImpl (std::filesystem::path _path, bool create, bool bare)
 
 operator git_repository * ()
 
void flush () override
 
uint64_t getRevCount (const Hash &rev) override
 
uint64_t getLastModified (const Hash &rev) override
 
bool isShallow () override
 
void setRemote (const std::string &name, const std::string &url) override
 
Hash resolveRef (std::string ref) override
 
std::vector< SubmoduleparseSubmodules (const std::filesystem::path &configFile)
 
WorkdirInfo getWorkdirInfo () override
 
std::optional< std::string > getWorkdirRef () override
 
std::vector< std::tuple< Submodule, Hash > > getSubmodules (const Hash &rev, bool exportIgnore) override
 
std::string resolveSubmoduleUrl (const std::string &url) override
 
bool hasObject (const Hash &oid_) override
 
ref< GitSourceAccessorgetRawAccessor (const Hash &rev)
 
ref< SourceAccessorgetAccessor (const Hash &rev, bool exportIgnore, std::string displayPrefix) override
 
ref< SourceAccessorgetAccessor (const WorkdirInfo &wd, bool exportIgnore, MakeNotAllowedError e) override
 
ref< GitFileSystemObjectSinkgetFileSystemObjectSink () override
 
void fetch (const std::string &url, const std::string &refspec, bool shallow) override
 
void verifyCommit (const Hash &rev, const std::vector< fetchers::PublicKey > &publicKeys) override
 
Hash treeHashToNarHash (const Hash &treeHash) override
 
Hash dereferenceSingletonDirectory (const Hash &oid_) override
 

Static Public Member Functions

static int statusCallbackTrampoline (const char *path, unsigned int statusFlags, void *payload)
 
static int sidebandProgressCallback (const char *str, int len, void *payload)
 
static int transferProgressCallback (const git_indexer_progress *stats, void *payload)
 
- Static Public Member Functions inherited from nix::GitRepo
static ref< GitRepoopenRepo (const std::filesystem::path &path, bool create=false, bool bare=false)
 
static WorkdirInfo getCachedWorkdirInfo (const std::filesystem::path &path)
 

Public Attributes

std::filesystem::path path
 
Repository repo
 
git_odb_backend * mempack_backend
 

Member Function Documentation

◆ dereferenceSingletonDirectory()

Hash nix::GitRepoImpl::dereferenceSingletonDirectory ( const Hash & oid)
inlineoverridevirtual

If the specified Git object is a directory with a single entry that is a directory, return the ID of that object. Otherwise, return the passed ID unchanged.

Implements nix::GitRepo.

◆ fetch()

void nix::GitRepoImpl::fetch ( const std::string & url,
const std::string & refspec,
bool shallow )
inlineoverridevirtual

Implements nix::GitRepo.

◆ flush()

void nix::GitRepoImpl::flush ( )
inlineoverridevirtual

Implements nix::GitRepo.

◆ getAccessor() [1/2]

ref< SourceAccessor > nix::GitRepoImpl::getAccessor ( const Hash & rev,
bool exportIgnore,
std::string displayPrefix )
overridevirtual

Implements nix::GitRepo.

◆ getAccessor() [2/2]

ref< SourceAccessor > nix::GitRepoImpl::getAccessor ( const WorkdirInfo & wd,
bool exportIgnore,
MakeNotAllowedError e )
overridevirtual

Implements nix::GitRepo.

◆ getFileSystemObjectSink()

ref< GitFileSystemObjectSink > nix::GitRepoImpl::getFileSystemObjectSink ( )
overridevirtual

Implements nix::GitRepo.

◆ getLastModified()

uint64_t nix::GitRepoImpl::getLastModified ( const Hash & rev)
inlineoverridevirtual

Implements nix::GitRepo.

◆ getRawAccessor()

ref< GitSourceAccessor > nix::GitRepoImpl::getRawAccessor ( const Hash & rev)

A 'GitSourceAccessor' with no regard for export-ignore or any other transformations.

◆ getRevCount()

uint64_t nix::GitRepoImpl::getRevCount ( const Hash & rev)
inlineoverridevirtual

Implements nix::GitRepo.

◆ getSubmodules()

std::vector< std::tuple< GitRepoImpl::Submodule, Hash > > nix::GitRepoImpl::getSubmodules ( const Hash & rev,
bool exportIgnore )
overridevirtual

Return the submodules of this repo at the indicated revision, along with the revision of each submodule.

Implements nix::GitRepo.

◆ getWorkdirInfo()

WorkdirInfo nix::GitRepoImpl::getWorkdirInfo ( )
inlineoverridevirtual

Implements nix::GitRepo.

◆ getWorkdirRef()

std::optional< std::string > nix::GitRepoImpl::getWorkdirRef ( )
inlineoverridevirtual

Implements nix::GitRepo.

◆ hasObject()

bool nix::GitRepoImpl::hasObject ( const Hash & oid_)
inlineoverridevirtual

Implements nix::GitRepo.

◆ isShallow()

bool nix::GitRepoImpl::isShallow ( )
inlineoverridevirtual

Implements nix::GitRepo.

◆ resolveRef()

Hash nix::GitRepoImpl::resolveRef ( std::string ref)
inlineoverridevirtual

Implements nix::GitRepo.

◆ resolveSubmoduleUrl()

std::string nix::GitRepoImpl::resolveSubmoduleUrl ( const std::string & url)
inlineoverridevirtual

Implements nix::GitRepo.

◆ setRemote()

void nix::GitRepoImpl::setRemote ( const std::string & name,
const std::string & url )
inlineoverridevirtual

Implements nix::GitRepo.

◆ treeHashToNarHash()

Hash nix::GitRepoImpl::treeHashToNarHash ( const Hash & treeHash)
inlineoverridevirtual

Given a Git tree hash, compute the hash of its NAR serialisation. This is memoised on-disk.

Implements nix::GitRepo.

◆ verifyCommit()

void nix::GitRepoImpl::verifyCommit ( const Hash & rev,
const std::vector< fetchers::PublicKey > & publicKeys )
inlineoverridevirtual

Verify that commit rev is signed by one of the keys in publicKeys. Throw an error if it isn't.

Implements nix::GitRepo.

Member Data Documentation

◆ mempack_backend

git_odb_backend* nix::GitRepoImpl::mempack_backend

In-memory object store for efficient batched writing to packfiles. Owned by repo.

◆ path

std::filesystem::path nix::GitRepoImpl::path

Location of the repository on disk.

◆ repo

Repository nix::GitRepoImpl::repo

libgit2 repository. Note that new objects are not written to disk, because we are using a mempack backend. For writing to disk, see flush(), which is also called by GitFileSystemObjectSink::sync().


The documentation for this struct was generated from the following file: