KiCad PCB EDA Suite
Loading...
Searching...
No Matches
LIBGIT_BACKEND Class Reference

#include <libgit_backend.h>

Inheritance diagram for LIBGIT_BACKEND:
GIT_BACKEND

Public Member Functions

void Init () override
 
void Shutdown () override
 
bool IsLibraryAvailable () override
 
bool Clone (GIT_CLONE_HANDLER *aHandler) override
 
CommitResult Commit (GIT_COMMIT_HANDLER *aHandler, const std::vector< wxString > &aFiles, const wxString &aMessage, const wxString &aAuthorName, const wxString &aAuthorEmail) override
 
CommitResult Amend (GIT_COMMIT_HANDLER *aHandler, const std::vector< wxString > &aFiles, const wxString &aMessage, const wxString &aAuthorName, const wxString &aAuthorEmail) override
 
PushResult Push (GIT_PUSH_HANDLER *aHandler, bool aForce=false) override
 
std::map< wxString, FileStatus > GetFileStatus (GIT_STATUS_HANDLER *aHandler, const wxString &aPathspec, bool aChangedOnly) override
 
wxString GetCurrentBranchName (GIT_STATUS_HANDLER *aHandler) override
 
void UpdateRemoteStatus (GIT_STATUS_HANDLER *aHandler, const std::set< wxString > &aLocalChanges, const std::set< wxString > &aRemoteChanges, std::map< wxString, FileStatus > &aFileStatus) override
 
wxString GetWorkingDirectory (GIT_STATUS_HANDLER *aHandler) override
 
bool GetConfigString (GIT_CONFIG_HANDLER *aHandler, const wxString &aKey, wxString &aValue) override
 
bool IsRepository (GIT_INIT_HANDLER *aHandler, const wxString &aPath) override
 
InitResult InitializeRepository (GIT_INIT_HANDLER *aHandler, const wxString &aPath) override
 
bool SetupRemote (GIT_INIT_HANDLER *aHandler, const RemoteConfig &aConfig) override
 
BranchResult SwitchToBranch (GIT_BRANCH_HANDLER *aHandler, const wxString &aBranchName) override
 
bool PerformFetch (GIT_PULL_HANDLER *aHandler, bool aSkipLock) override
 
PullResult PerformPull (GIT_PULL_HANDLER *aHandler) override
 
git_repository * GetRepositoryForFile (const char *aFilename, wxString *aError, wxString *aTrustCommand) override
 aError receives why git refused to open the repository, and aTrustCommand the command that trusts it when another user owns it.
 
int CreateBranch (git_repository *aRepo, const wxString &aBranchName, const wxString &aFrom) override
 
bool RemoveVCS (git_repository *&aRepo, const wxString &aProjectPath, bool aRemoveGitDir, wxString *aErrors) override
 
bool DeleteBranch (git_repository *aRepo, const wxString &aBranchName) override
 
bool StashSave (git_repository *aRepo, const wxString &aMessage) override
 
bool StashApply (git_repository *aRepo, size_t aIndex) override
 
bool StashPop (git_repository *aRepo, size_t aIndex) override
 
bool StashDrop (git_repository *aRepo, size_t aIndex) override
 
bool CreateTag (git_repository *aRepo, const wxString &aName, const wxString &aMessage) override
 
bool DeleteTag (git_repository *aRepo, const wxString &aName) override
 
bool CheckoutTag (git_repository *aRepo, const wxString &aName) override
 
bool AddRemote (git_repository *aRepo, const wxString &aName, const wxString &aUrl) override
 
bool SetRemoteUrl (git_repository *aRepo, const wxString &aName, const wxString &aUrl) override
 
bool RemoveRemote (git_repository *aRepo, const wxString &aName) override
 
bool SetUserConfig (git_repository *aRepo, const wxString &aName, const wxString &aEmail) override
 
RestoreResult RestoreVersion (KIGIT_COMMON &aCommon, const wxString &aCommitHash, KIGIT_ERROR_MESSAGE &aError) override
 
bool DiscardChanges (git_repository *aRepo, const std::vector< wxString > &aPaths, wxString &aError) override
 
bool IsPathInHead (git_repository *aRepo, const wxString &aPath) override
 
bool AbandonOperation (git_repository *aRepo, wxString &aError) override
 Drop a merge, rebase, cherry-pick or revert left in progress and return to the last commit.
 
bool GetMergeConflicts (git_repository *aRepo, const wxString &aStageDir, wxString &aHeadOid, wxString &aTheirsOid, std::vector< KIGIT_CONFLICT_SIDES > &aConflicts, wxString &aError) override
 
MergeCommitResult CreateMergedCommit (git_repository *aRepo, const wxString &aExpectedHeadOid, const wxString &aTheirsOid, const std::vector< std::pair< wxString, wxString > > &aResolvedFiles, KIGIT_ERROR_MESSAGE &aError) override
 
KIGIT_ORPHAN_REGISTRY & OrphanRegistry ()
 Return the process-wide orphan thread registry owned by this backend.
 

Protected Attributes

KIGIT_ORPHAN_REGISTRY m_orphanRegistry
 

Private Member Functions

PullResult handleFastForward (GIT_PULL_HANDLER *aHandler)
 
PullResult handleMerge (GIT_PULL_HANDLER *aHandler, const git_annotated_commit **aMergeHeads, size_t aMergeHeadsCount)
 
PullResult handleRebase (GIT_PULL_HANDLER *aHandler, const git_annotated_commit **aMergeHeads, size_t aMergeHeadsCount)
 

Static Private Member Functions

static bool hasUnstagedChanges (git_repository *aRepo)
 

Detailed Description

Definition at line 29 of file libgit_backend.h.

Member Function Documentation

◆ AbandonOperation()

bool LIBGIT_BACKEND::AbandonOperation ( git_repository * aRepo,
wxString & aError )
overridevirtual

Drop a merge, rebase, cherry-pick or revert left in progress and return to the last commit.

Implements GIT_BACKEND.

Definition at line 3348 of file libgit_backend.cpp.

References _, KIGIT::CollectDiffDeltas(), KIGIT_COMMON::GetLastGitError(), git_repository, index, and path.

◆ AddRemote()

bool LIBGIT_BACKEND::AddRemote ( git_repository * aRepo,
const wxString & aName,
const wxString & aUrl )
overridevirtual

Implements GIT_BACKEND.

Definition at line 2648 of file libgit_backend.cpp.

References git_repository.

◆ Amend()

◆ CheckoutTag()

bool LIBGIT_BACKEND::CheckoutTag ( git_repository * aRepo,
const wxString & aName )
overridevirtual

Implements GIT_BACKEND.

Definition at line 2624 of file libgit_backend.cpp.

References git_repository.

◆ Clone()

◆ Commit()

◆ CreateBranch()

int LIBGIT_BACKEND::CreateBranch ( git_repository * aRepo,
const wxString & aBranchName,
const wxString & aFrom )
overridevirtual

Implements GIT_BACKEND.

Definition at line 2424 of file libgit_backend.cpp.

References KIGIT_COMMON::GetLastGitError(), git_repository, name, and traceGit.

◆ CreateMergedCommit()

MergeCommitResult LIBGIT_BACKEND::CreateMergedCommit ( git_repository * aRepo,
const wxString & aExpectedHeadOid,
const wxString & aTheirsOid,
const std::vector< std::pair< wxString, wxString > > & aResolvedFiles,
KIGIT_ERROR_MESSAGE & aError )
overridevirtual

◆ CreateTag()

bool LIBGIT_BACKEND::CreateTag ( git_repository * aRepo,
const wxString & aName,
const wxString & aMessage )
overridevirtual

Implements GIT_BACKEND.

Definition at line 2585 of file libgit_backend.cpp.

References git_repository, message, and name.

◆ DeleteBranch()

bool LIBGIT_BACKEND::DeleteBranch ( git_repository * aRepo,
const wxString & aBranchName )
overridevirtual

Implements GIT_BACKEND.

Definition at line 2462 of file libgit_backend.cpp.

References git_repository.

◆ DeleteTag()

bool LIBGIT_BACKEND::DeleteTag ( git_repository * aRepo,
const wxString & aName )
overridevirtual

Implements GIT_BACKEND.

Definition at line 2615 of file libgit_backend.cpp.

References git_repository.

◆ DiscardChanges()

bool LIBGIT_BACKEND::DiscardChanges ( git_repository * aRepo,
const std::vector< wxString > & aPaths,
wxString & aError )
overridevirtual

Implements GIT_BACKEND.

Definition at line 3244 of file libgit_backend.cpp.

References _, KIGIT_COMMON::GetLastGitError(), git_repository, index, IsPathInHead(), and path.

◆ GetConfigString()

bool LIBGIT_BACKEND::GetConfigString ( GIT_CONFIG_HANDLER * aHandler,
const wxString & aKey,
wxString & aValue )
overridevirtual

◆ GetCurrentBranchName()

wxString LIBGIT_BACKEND::GetCurrentBranchName ( GIT_STATUS_HANDLER * aHandler)
overridevirtual

◆ GetFileStatus()

std::map< wxString, FileStatus > LIBGIT_BACKEND::GetFileStatus ( GIT_STATUS_HANDLER * aHandler,
const wxString & aPathspec,
bool aChangedOnly )
overridevirtual

◆ GetMergeConflicts()

bool LIBGIT_BACKEND::GetMergeConflicts ( git_repository * aRepo,
const wxString & aStageDir,
wxString & aHeadOid,
wxString & aTheirsOid,
std::vector< KIGIT_CONFLICT_SIDES > & aConflicts,
wxString & aError )
overridevirtual

◆ GetRepositoryForFile()

git_repository * LIBGIT_BACKEND::GetRepositoryForFile ( const char * aFilename,
wxString * aError,
wxString * aTrustCommand )
overridevirtual

aError receives why git refused to open the repository, and aTrustCommand the command that trusts it when another user owns it.

Both are untouched otherwise.

Implements GIT_BACKEND.

Definition at line 2390 of file libgit_backend.cpp.

References KIGIT::DescribeOwnershipRefusal(), KIGIT_COMMON::GetLastGitError(), GIT_BUF_INIT, git_repository, KIGIT_OWNERSHIP_REFUSAL::summary, traceGit, and KIGIT_OWNERSHIP_REFUSAL::trustCommand.

◆ GetWorkingDirectory()

wxString LIBGIT_BACKEND::GetWorkingDirectory ( GIT_STATUS_HANDLER * aHandler)
overridevirtual

Implements GIT_BACKEND.

Definition at line 1164 of file libgit_backend.cpp.

References KIGIT_REPO_MIXIN::GetProjectDir().

◆ handleFastForward()

◆ handleMerge()

◆ handleRebase()

PullResult LIBGIT_BACKEND::handleRebase ( GIT_PULL_HANDLER * aHandler,
const git_annotated_commit ** aMergeHeads,
size_t aMergeHeadsCount )
private

◆ hasUnstagedChanges()

bool LIBGIT_BACKEND::hasUnstagedChanges ( git_repository * aRepo)
staticprivate

Definition at line 2097 of file libgit_backend.cpp.

References KIGIT_COMMON::GetLastGitError(), git_repository, and traceGit.

Referenced by handleMerge(), and handleRebase().

◆ Init()

void LIBGIT_BACKEND::Init ( )
overridevirtual

Implements GIT_BACKEND.

Definition at line 52 of file libgit_backend.cpp.

References KIGIT_COMMON::GetLastGitError(), and traceGit.

◆ InitializeRepository()

InitResult LIBGIT_BACKEND::InitializeRepository ( GIT_INIT_HANDLER * aHandler,
const wxString & aPath )
overridevirtual

◆ IsLibraryAvailable()

bool LIBGIT_BACKEND::IsLibraryAvailable ( )
overridevirtual

Implements GIT_BACKEND.

Definition at line 103 of file libgit_backend.cpp.

◆ IsPathInHead()

bool LIBGIT_BACKEND::IsPathInHead ( git_repository * aRepo,
const wxString & aPath )
overridevirtual

Implements GIT_BACKEND.

Definition at line 3315 of file libgit_backend.cpp.

References git_repository.

Referenced by DiscardChanges(), and SwitchToBranch().

◆ IsRepository()

bool LIBGIT_BACKEND::IsRepository ( GIT_INIT_HANDLER * aHandler,
const wxString & aPath )
overridevirtual

Implements GIT_BACKEND.

Definition at line 1202 of file libgit_backend.cpp.

References git_repository.

Referenced by InitializeRepository().

◆ OrphanRegistry()

KIGIT_ORPHAN_REGISTRY & GIT_BACKEND::OrphanRegistry ( )
inlineinherited

Return the process-wide orphan thread registry owned by this backend.

Callers that abandon a long-running git operation must route their cleanup thread through this registry so the shutdown path can wait for libgit2 workers to finish before calling git_libgit2_shutdown().

Definition at line 92 of file git_backend.h.

References m_orphanRegistry.

Referenced by KIGIT::PROJECT_GIT_UTILS::SafeFreeRepository(), and KIGIT::StartTransfer().

◆ PerformFetch()

◆ PerformPull()

◆ Push()

◆ RemoveRemote()

bool LIBGIT_BACKEND::RemoveRemote ( git_repository * aRepo,
const wxString & aName )
overridevirtual

Implements GIT_BACKEND.

Definition at line 2672 of file libgit_backend.cpp.

References git_repository.

◆ RemoveVCS()

bool LIBGIT_BACKEND::RemoveVCS ( git_repository *& aRepo,
const wxString & aProjectPath,
bool aRemoveGitDir,
wxString * aErrors )
overridevirtual

Implements GIT_BACKEND.

Definition at line 3800 of file libgit_backend.cpp.

References git_repository, RmDirRecursive(), and traceGit.

◆ RestoreVersion()

◆ SetRemoteUrl()

bool LIBGIT_BACKEND::SetRemoteUrl ( git_repository * aRepo,
const wxString & aName,
const wxString & aUrl )
overridevirtual

Implements GIT_BACKEND.

Definition at line 2663 of file libgit_backend.cpp.

References git_repository.

◆ SetupRemote()

◆ SetUserConfig()

bool LIBGIT_BACKEND::SetUserConfig ( git_repository * aRepo,
const wxString & aName,
const wxString & aEmail )
overridevirtual

Implements GIT_BACKEND.

Definition at line 2681 of file libgit_backend.cpp.

References config, and git_repository.

◆ Shutdown()

void LIBGIT_BACKEND::Shutdown ( )
overridevirtual

Implements GIT_BACKEND.

Definition at line 73 of file libgit_backend.cpp.

References GIT_BACKEND::m_orphanRegistry, and traceGit.

◆ StashApply()

bool LIBGIT_BACKEND::StashApply ( git_repository * aRepo,
size_t aIndex )
overridevirtual

Implements GIT_BACKEND.

Definition at line 2567 of file libgit_backend.cpp.

References applyStashOntoCleanTree(), and git_repository.

◆ StashDrop()

bool LIBGIT_BACKEND::StashDrop ( git_repository * aRepo,
size_t aIndex )
overridevirtual

Implements GIT_BACKEND.

Definition at line 2579 of file libgit_backend.cpp.

References git_repository.

◆ StashPop()

bool LIBGIT_BACKEND::StashPop ( git_repository * aRepo,
size_t aIndex )
overridevirtual

Implements GIT_BACKEND.

Definition at line 2573 of file libgit_backend.cpp.

References applyStashOntoCleanTree(), and git_repository.

◆ StashSave()

bool LIBGIT_BACKEND::StashSave ( git_repository * aRepo,
const wxString & aMessage )
overridevirtual

Implements GIT_BACKEND.

Definition at line 2477 of file libgit_backend.cpp.

References git_repository, index, and message.

◆ SwitchToBranch()

◆ UpdateRemoteStatus()

void LIBGIT_BACKEND::UpdateRemoteStatus ( GIT_STATUS_HANDLER * aHandler,
const std::set< wxString > & aLocalChanges,
const std::set< wxString > & aRemoteChanges,
std::map< wxString, FileStatus > & aFileStatus )
overridevirtual

Member Data Documentation

◆ m_orphanRegistry

KIGIT_ORPHAN_REGISTRY GIT_BACKEND::m_orphanRegistry
protectedinherited

Definition at line 180 of file git_backend.h.

Referenced by OrphanRegistry(), and LIBGIT_BACKEND::Shutdown().


The documentation for this class was generated from the following files: