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
 
UndoCommitResult UndoLastCommit (GIT_COMMIT_HANDLER *aHandler, const wxString &aExpectedBranch, const git_oid &aExpectedHead, wxString &aMessage) override
 Move aExpectedBranch back to the parent of aExpectedHead, leaving the index and working files as they are.
 
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 3668 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 2968 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 2944 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 2744 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 2905 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 2782 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 2935 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 3564 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 2703 of file libgit_backend.cpp.

References KIGIT::DescribeOwnershipRefusal(), KIGIT_COMMON::GetLastGitError(), GIT_BUF_INIT, git_repository, refusal(), and traceGit.

◆ GetWorkingDirectory()

wxString LIBGIT_BACKEND::GetWorkingDirectory ( GIT_STATUS_HANDLER * aHandler)
overridevirtual

Implements GIT_BACKEND.

Definition at line 1327 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 2410 of file libgit_backend.cpp.

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

Referenced by handleMerge(), and handleRebase().

◆ Init()

void LIBGIT_BACKEND::Init ( )
overridevirtual

◆ InitializeRepository()

◆ IsLibraryAvailable()

bool LIBGIT_BACKEND::IsLibraryAvailable ( )
overridevirtual

Implements GIT_BACKEND.

Definition at line 111 of file libgit_backend.cpp.

◆ IsPathInHead()

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

Implements GIT_BACKEND.

Definition at line 3635 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 1365 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 108 of file git_backend.h.

References m_orphanRegistry.

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

◆ PerformFetch()

bool LIBGIT_BACKEND::PerformFetch ( GIT_PULL_HANDLER * aHandler,
bool aSkipLock )
overridevirtual

Implements GIT_BACKEND.

Definition at line 1818 of file libgit_backend.cpp.

References fetchRemote().

◆ PerformPull()

◆ Push()

◆ RemoveRemote()

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

Implements GIT_BACKEND.

Definition at line 2992 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 4130 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 2983 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 3001 of file libgit_backend.cpp.

References config, and git_repository.

◆ Shutdown()

void LIBGIT_BACKEND::Shutdown ( )
overridevirtual

Implements GIT_BACKEND.

Definition at line 81 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 2887 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 2899 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 2893 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 2797 of file libgit_backend.cpp.

References git_repository, index, and message.

◆ SwitchToBranch()

◆ UndoLastCommit()

UndoCommitResult LIBGIT_BACKEND::UndoLastCommit ( GIT_COMMIT_HANDLER * aHandler,
const wxString & aExpectedBranch,
const git_oid & aExpectedHead,
wxString & aMessage )
overridevirtual

Move aExpectedBranch back to the parent of aExpectedHead, leaving the index and working files as they are.

aMessage receives the undone commit's full message, or on Published the remote-tracking branch holding it.

Implements GIT_BACKEND.

Definition at line 926 of file libgit_backend.cpp.

References _, KIGIT_ERRORS::AddErrorString(), KIGIT_ERRORS::AddGitError(), Error, KIGIT_COMMON::GetRepo(), git_repository, KIGIT_COMMON::IsOperationInProgress(), moved, NoCommit, Published, reachableFromRemote(), Success, and TargetChanged.

◆ 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 202 of file git_backend.h.

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


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