|
KiCad PCB EDA Suite
|
#include <libgit_backend.h>
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) |
Definition at line 29 of file libgit_backend.h.
|
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.
|
overridevirtual |
Implements GIT_BACKEND.
Definition at line 2648 of file libgit_backend.cpp.
References git_repository.
|
overridevirtual |
Implements GIT_BACKEND.
Definition at line 746 of file libgit_backend.cpp.
References _, KIGIT_ERRORS::AddError(), KIGIT_ERRORS::AddErrorString(), KIGIT_ERRORS::AddGitError(), SCRATCH_INDEX_GUARD::armed, COMMIT_STAGING::Begin(), COMMIT_STAGING::BuildTree(), CHANGED_EXTERNALLY, COMMIT_STAGING::committedEntries, Error, KIGIT_COMMON::GetRepo(), git_repository, COMMIT_STAGING::haveIndexAtStart, COMMIT_STAGING::index, index, COMMIT_STAGING::indexAtStart, indexChangedSince(), republishIndex(), COMMIT_STAGING::scratchGuard, COMMIT_STAGING::selectedAtStart, COMMIT_STAGING::selectedPaths, selectedPathsRestaged(), Success, SuccessIndexStale, and WRITE_FAILED.
|
overridevirtual |
Implements GIT_BACKEND.
Definition at line 2624 of file libgit_backend.cpp.
References git_repository.
|
overridevirtual |
Implements GIT_BACKEND.
Definition at line 156 of file libgit_backend.cpp.
References _, KIGIT_ERRORS::AddErrorString(), KIGIT_REPO_MIXIN::CancelToken(), certificate_check_cb(), CLONE, clone_progress_cb(), clone_remote_cb(), credentials_cb(), KIGIT_REPO_MIXIN::GetActionLock(), GIT_CLONE_HANDLER::GetClonePath(), KIGIT_REPO_MIXIN::GetCommon(), KIGIT_COMMON::GetLastGitErrorInfo(), KIGIT_COMMON::GetRemote(), git_repository, KIGIT_REPO_MIXIN::IsThisOperationCancelled(), KIGIT_REPO_MIXIN::ReportTransferFailure(), KIGIT_REPO_MIXIN::ResetTransferState(), KIGIT_COMMON::SetRepo(), traceGit, and transfer_progress_cb().
|
overridevirtual |
Implements GIT_BACKEND.
Definition at line 598 of file libgit_backend.cpp.
References _, KIGIT_ERRORS::AddError(), KIGIT_ERRORS::AddErrorString(), KIGIT_ERRORS::AddGitError(), SCRATCH_INDEX_GUARD::armed, COMMIT_STAGING::Begin(), COMMIT_STAGING::BuildTree(), CHANGED_EXTERNALLY, COMMIT_STAGING::committedEntries, Error, KIGIT_COMMON::GetRepo(), git_repository, COMMIT_STAGING::haveIndexAtStart, COMMIT_STAGING::index, index, COMMIT_STAGING::indexAtStart, indexChangedSince(), republishIndex(), COMMIT_STAGING::scratchGuard, COMMIT_STAGING::selectedAtStart, COMMIT_STAGING::selectedPaths, selectedPathsRestaged(), Success, SuccessIndexStale, and WRITE_FAILED.
|
overridevirtual |
Implements GIT_BACKEND.
Definition at line 2424 of file libgit_backend.cpp.
References KIGIT_COMMON::GetLastGitError(), git_repository, name, and traceGit.
|
overridevirtual |
Implements GIT_BACKEND.
Definition at line 3600 of file libgit_backend.cpp.
References _, bytes(), CHECKOUT_FAILED_PARTIAL, CHECKOUT_FAILED_ROLLED_BACK, describeSignatureFailure(), KIGIT_ERROR_MESSAGE::details, FailedCleanly, FailedPartially, KIGIT_COMMON::GetLastGitError(), git_repository, message, path, PUBLISHED, publishPreparedCommit(), RECORD_FAILED_PARTIAL, RECORD_FAILED_ROLLED_BACK, and Success.
|
overridevirtual |
Implements GIT_BACKEND.
Definition at line 2585 of file libgit_backend.cpp.
References git_repository, message, and name.
|
overridevirtual |
Implements GIT_BACKEND.
Definition at line 2462 of file libgit_backend.cpp.
References git_repository.
|
overridevirtual |
Implements GIT_BACKEND.
Definition at line 2615 of file libgit_backend.cpp.
References git_repository.
|
overridevirtual |
Implements GIT_BACKEND.
Definition at line 3244 of file libgit_backend.cpp.
References _, KIGIT_COMMON::GetLastGitError(), git_repository, index, IsPathInHead(), and path.
|
overridevirtual |
Implements GIT_BACKEND.
Definition at line 1170 of file libgit_backend.cpp.
References config, KIGIT_COMMON::GetLastGitError(), KIGIT_REPO_MIXIN::GetRepo(), git_repository, result, and traceGit.
|
overridevirtual |
Implements GIT_BACKEND.
Definition at line 1100 of file libgit_backend.cpp.
References KIGIT_COMMON::GetLastGitError(), KIGIT_REPO_MIXIN::GetRepo(), git_repository, and traceGit.
|
overridevirtual |
Implements GIT_BACKEND.
Definition at line 1036 of file libgit_backend.cpp.
References GIT_STATUS_HANDLER::ConvertStatus(), KIGIT_COMMON::GetLastGitError(), KIGIT_REPO_MIXIN::GetProjectDir(), KIGIT_REPO_MIXIN::GetRepo(), git_repository, path, and traceGit.
|
overridevirtual |
Implements GIT_BACKEND.
Definition at line 3509 of file libgit_backend.cpp.
References _, KIGIT_CONFLICT_SIDES::ancestorFile, git_repository, KIGIT_CONFLICT_SIDES::hasAncestor, KIGIT_CONFLICT_SIDES::hasOurs, KIGIT_CONFLICT_SIDES::hasTheirs, KIGIT_CONFLICT_SIDES::oursFile, KIGIT_CONFLICT_SIDES::path, and KIGIT_CONFLICT_SIDES::theirsFile.
|
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.
|
overridevirtual |
Implements GIT_BACKEND.
Definition at line 1164 of file libgit_backend.cpp.
References KIGIT_REPO_MIXIN::GetProjectDir().
|
private |
Definition at line 1913 of file libgit_backend.cpp.
References _, KIGIT_ERRORS::AddError(), KIGIT_ERRORS::AddErrorString(), KIGIT_ERRORS::AddGitError(), describeUntrackedCollisions(), DIRTY, DirtyWorkdir, Error, FastForward, KIGIT_COMMON::GetLastGitError(), KIGIT_REPO_MIXIN::GetRemotename(), KIGIT_REPO_MIXIN::GetRepo(), path, refreshCachedIndex(), rollbackWorkingTree(), traceGit, trackedTreeState(), UNKNOWN, and untrackedFilesOverwrittenBy().
Referenced by PerformPull().
|
private |
Definition at line 2134 of file libgit_backend.cpp.
References _, KIGIT_ERRORS::AddError(), KIGIT_ERRORS::AddErrorString(), KIGIT_ERRORS::AddGitError(), Conflict, describeSignatureFailure(), describeUntrackedCollisions(), DirtyWorkdir, Error, KIGIT_REPO_MIXIN::GetRepo(), git_repository, hasUnstagedChanges(), index, MergeFailed, message, Success, and untrackedFilesOverwrittenBy().
Referenced by PerformPull().
|
private |
Definition at line 2375 of file libgit_backend.cpp.
References _, KIGIT_ERRORS::AddErrorString(), DirtyWorkdir, KIGIT_REPO_MIXIN::GetRepo(), hasUnstagedChanges(), and rebaseOnto().
Referenced by PerformPull().
|
staticprivate |
Definition at line 2097 of file libgit_backend.cpp.
References KIGIT_COMMON::GetLastGitError(), git_repository, and traceGit.
Referenced by handleMerge(), and handleRebase().
|
overridevirtual |
Implements GIT_BACKEND.
Definition at line 52 of file libgit_backend.cpp.
References KIGIT_COMMON::GetLastGitError(), and traceGit.
|
overridevirtual |
Implements GIT_BACKEND.
Definition at line 1219 of file libgit_backend.cpp.
References _, KIGIT_ERRORS::AddError(), AlreadyExists, Error, KIGIT_REPO_MIXIN::GetCommon(), KIGIT_COMMON::GetLastGitError(), git_repository, IsRepository(), KIGIT_COMMON::SetRepo(), Success, and traceGit.
|
overridevirtual |
Implements GIT_BACKEND.
Definition at line 103 of file libgit_backend.cpp.
|
overridevirtual |
Implements GIT_BACKEND.
Definition at line 3315 of file libgit_backend.cpp.
References git_repository.
Referenced by DiscardChanges(), and SwitchToBranch().
|
overridevirtual |
Implements GIT_BACKEND.
Definition at line 1202 of file libgit_backend.cpp.
References git_repository.
Referenced by InitializeRepository().
|
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().
|
overridevirtual |
Implements GIT_BACKEND.
Definition at line 1432 of file libgit_backend.cpp.
References KIGIT_ERRORS::AddErrorString(), KIGIT::BusyMessage(), KIGIT_REPO_MIXIN::CancelToken(), certificate_check_cb(), credentials_cb(), FETCH, KIGIT_REPO_MIXIN::GetActionLock(), KIGIT_REPO_MIXIN::GetCommon(), KIGIT_COMMON::GetLastGitErrorInfo(), KIGIT_COMMON::GetRemoteNameOrDefault(), KIGIT_REPO_MIXIN::GetRepo(), KIGIT_REPO_MIXIN::IsThisOperationCancelled(), progress_cb(), reportRemoteLookupFailure(), KIGIT_REPO_MIXIN::ReportTransferFailure(), KIGIT_REPO_MIXIN::ResetTransferState(), KIGIT_COMMON::SyncRemoteUrl(), traceGit, and transfer_progress_cb().
Referenced by PerformPull().
|
overridevirtual |
Implements GIT_BACKEND.
Definition at line 1741 of file libgit_backend.cpp.
References _, KIGIT_ERRORS::AddErrorString(), KIGIT_ERRORS::AddGitError(), adoptRemoteHistory(), KIGIT::BusyMessage(), KIGIT_REPO_MIXIN::CancelToken(), config, Error, fetchhead_foreach_cb(), KIGIT_REPO_MIXIN::GetActionLock(), KIGIT_REPO_MIXIN::GetCommon(), KIGIT_COMMON::GetRemoteNameOrDefault(), KIGIT_REPO_MIXIN::GetRepo(), handleFastForward(), handleMerge(), handleRebase(), KIGIT_REPO_MIXIN::IsThisOperationCancelled(), PerformFetch(), KIGIT::PROJECT_GIT_UTILS::ProjectUsesGitLfs(), result, Success, traceGit, and UpToDate.
|
overridevirtual |
Implements GIT_BACKEND.
Definition at line 867 of file libgit_backend.cpp.
References _, KIGIT_ERRORS::AddErrorString(), Busy, KIGIT_REPO_MIXIN::CancelToken(), certificate_check_cb(), credentials_cb(), Error, KIGIT_REPO_MIXIN::GetActionLock(), KIGIT_REPO_MIXIN::GetCommon(), KIGIT_COMMON::GetLastGitErrorInfo(), KIGIT_COMMON::GetRemoteNameOrDefault(), KIGIT_REPO_MIXIN::GetRepo(), GIT_PUSH_HANDLER::HasExpectedTarget(), KIGIT_REPO_MIXIN::IsThisOperationCancelled(), GIT_PUSH_HANDLER::MatchesExpectedTarget(), NonFastForward, progress_cb(), PUSH, push_transfer_progress_cb(), push_update_reference_cb(), reportRemoteLookupFailure(), KIGIT_REPO_MIXIN::ReportTransferFailure(), KIGIT_REPO_MIXIN::ResetTransferState(), result, Success, KIGIT_COMMON::SyncRemoteUrl(), traceGit, transfer_progress_cb(), and update_cb().
|
overridevirtual |
Implements GIT_BACKEND.
Definition at line 2672 of file libgit_backend.cpp.
References git_repository.
|
overridevirtual |
Implements GIT_BACKEND.
Definition at line 3800 of file libgit_backend.cpp.
References git_repository, RmDirRecursive(), and traceGit.
|
overridevirtual |
Implements GIT_BACKEND.
Definition at line 3003 of file libgit_backend.cpp.
References _, AlreadyCurrent, CHECKOUT_FAILED_PARTIAL, CHECKOUT_FAILED_ROLLED_BACK, describeSignatureFailure(), KIGIT_ERROR_MESSAGE::details, Dirty, Error, KIGIT_COMMON::GetLastGitError(), KIGIT_COMMON::GetProjectPrefix(), KIGIT_COMMON::GetRepo(), git_repository, message, path, PUBLISHED, publishPreparedCommit(), RECORD_FAILED_PARTIAL, RECORD_FAILED_ROLLED_BACK, and Restored.
|
overridevirtual |
Implements GIT_BACKEND.
Definition at line 2663 of file libgit_backend.cpp.
References git_repository.
|
overridevirtual |
Implements GIT_BACKEND.
Definition at line 1245 of file libgit_backend.cpp.
References _, KIGIT_ERRORS::AddError(), KIGIT_ERRORS::AddErrorString(), KIGIT::DescribeGitFailure(), KIGIT_FAILURE_REPORT::details, KIGIT_REPO_MIXIN::GetCommon(), KIGIT_COMMON::GetLastGitErrorInfo(), KIGIT_REPO_MIXIN::GetRepo(), git_repository, KIGIT_FAILURE_CONTEXT::operation, KIGIT_COMMON::ParseRemoteURL(), KIGIT_COMMON::REMOTE_URL::password, RemoteConfig::password, KIGIT_FAILURE_CONTEXT::remoteName, SET_UP_REMOTE, KIGIT_COMMON::SetPassword(), KIGIT_COMMON::SetRemote(), KIGIT_COMMON::SetSSHKey(), KIGIT_COMMON::SetUsername(), RemoteConfig::sshKey, KIGIT_FAILURE_REPORT::summary, traceGit, KIGIT_COMMON::REMOTE_URL::url, KIGIT_FAILURE_CONTEXT::url, RemoteConfig::url, KIGIT_COMMON::REMOTE_URL::username, and RemoteConfig::username.
|
overridevirtual |
Implements GIT_BACKEND.
Definition at line 2681 of file libgit_backend.cpp.
References config, and git_repository.
|
overridevirtual |
Implements GIT_BACKEND.
Definition at line 73 of file libgit_backend.cpp.
References GIT_BACKEND::m_orphanRegistry, and traceGit.
|
overridevirtual |
Implements GIT_BACKEND.
Definition at line 2567 of file libgit_backend.cpp.
References applyStashOntoCleanTree(), and git_repository.
|
overridevirtual |
Implements GIT_BACKEND.
Definition at line 2579 of file libgit_backend.cpp.
References git_repository.
|
overridevirtual |
Implements GIT_BACKEND.
Definition at line 2573 of file libgit_backend.cpp.
References applyStashOntoCleanTree(), and git_repository.
|
overridevirtual |
Implements GIT_BACKEND.
Definition at line 2477 of file libgit_backend.cpp.
References git_repository, index, and message.
|
overridevirtual |
Implements GIT_BACKEND.
Definition at line 1310 of file libgit_backend.cpp.
References _, KIGIT_ERRORS::AddError(), KIGIT_ERRORS::AddErrorString(), BranchNotFound, CheckoutFailed, Conflict, Error, KIGIT_COMMON::GetLastGitError(), KIGIT_REPO_MIXIN::GetRepo(), git_repository, IsPathInHead(), lookup_branch_reference(), Success, and traceGit.
|
overridevirtual |
Implements GIT_BACKEND.
Definition at line 1127 of file libgit_backend.cpp.
References KIGIT_REPO_MIXIN::GetProjectDir(), KIGIT_REPO_MIXIN::GetRepo(), git_repository, KIGIT_COMMON::GIT_STATUS_AHEAD, KIGIT_COMMON::GIT_STATUS_BEHIND, and KIGIT_COMMON::GIT_STATUS_CURRENT.
|
protectedinherited |
Definition at line 180 of file git_backend.h.
Referenced by OrphanRegistry(), and LIBGIT_BACKEND::Shutdown().