|
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 |
| 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) |
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 3668 of file libgit_backend.cpp.
References _, KIGIT::CollectDiffDeltas(), KIGIT_COMMON::GetLastGitError(), git_repository, index, and path.
|
overridevirtual |
Implements GIT_BACKEND.
Definition at line 2968 of file libgit_backend.cpp.
References git_repository.
|
overridevirtual |
Implements GIT_BACKEND.
Definition at line 723 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 2944 of file libgit_backend.cpp.
References git_repository.
|
overridevirtual |
Implements GIT_BACKEND.
Definition at line 149 of file libgit_backend.cpp.
References _, KIGIT_ERRORS::AddErrorString(), KIGIT_REPO_MIXIN::CancelToken(), CLONE, KIGIT::REMOTE_TRANSPORT::Clone(), KIGIT::REMOTE_TRANSPORT::Error(), KIGIT_REPO_MIXIN::GetActionLock(), GIT_CLONE_HANDLER::GetClonePath(), KIGIT_REPO_MIXIN::GetCommon(), KIGIT_COMMON::GetRemote(), git_repository, KIGIT_REPO_MIXIN::IsThisOperationCancelled(), KIGIT_REPO_MIXIN::ReportTransferFailure(), KIGIT_COMMON::SetRepo(), and traceGit.
|
overridevirtual |
Implements GIT_BACKEND.
Definition at line 575 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 2744 of file libgit_backend.cpp.
References KIGIT_COMMON::GetLastGitError(), git_repository, name, and traceGit.
|
overridevirtual |
Implements GIT_BACKEND.
Definition at line 3920 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 2905 of file libgit_backend.cpp.
References git_repository, message, and name.
|
overridevirtual |
Implements GIT_BACKEND.
Definition at line 2782 of file libgit_backend.cpp.
References git_repository.
|
overridevirtual |
Implements GIT_BACKEND.
Definition at line 2935 of file libgit_backend.cpp.
References git_repository.
|
overridevirtual |
Implements GIT_BACKEND.
Definition at line 3564 of file libgit_backend.cpp.
References _, KIGIT_COMMON::GetLastGitError(), git_repository, index, IsPathInHead(), and path.
|
overridevirtual |
Implements GIT_BACKEND.
Definition at line 1333 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 1263 of file libgit_backend.cpp.
References KIGIT_COMMON::GetLastGitError(), KIGIT_REPO_MIXIN::GetRepo(), git_repository, and traceGit.
|
overridevirtual |
Implements GIT_BACKEND.
Definition at line 1192 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 3829 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 2703 of file libgit_backend.cpp.
References KIGIT::DescribeOwnershipRefusal(), KIGIT_COMMON::GetLastGitError(), GIT_BUF_INIT, git_repository, refusal(), and traceGit.
|
overridevirtual |
Implements GIT_BACKEND.
Definition at line 1327 of file libgit_backend.cpp.
References KIGIT_REPO_MIXIN::GetProjectDir().
|
private |
Definition at line 2226 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 2447 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 2688 of file libgit_backend.cpp.
References _, KIGIT_ERRORS::AddErrorString(), DirtyWorkdir, KIGIT_REPO_MIXIN::GetRepo(), hasUnstagedChanges(), and rebaseOnto().
Referenced by PerformPull().
|
staticprivate |
Definition at line 2410 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 56 of file libgit_backend.cpp.
References KIGIT_COMMON::GetLastGitError(), PATHS::GetUserCachePath(), KIGIT::SetDerivedPublicKeyFolder(), KIGIT::SetRememberedSSHKeyStore(), and traceGit.
|
overridevirtual |
Implements GIT_BACKEND.
Definition at line 1427 of file libgit_backend.cpp.
References _, KIGIT_ERRORS::AddError(), KIGIT_ERRORS::AddGitError(), AlreadyExists, Error, KIGIT_REPO_MIXIN::GetCommon(), KIGIT_COMMON::GetLastGitError(), git_repository, IsRepository(), markForRemoteBranchAdoption(), KIGIT_COMMON::SetRepo(), Success, and traceGit.
|
overridevirtual |
Implements GIT_BACKEND.
Definition at line 111 of file libgit_backend.cpp.
|
overridevirtual |
Implements GIT_BACKEND.
Definition at line 3635 of file libgit_backend.cpp.
References git_repository.
Referenced by DiscardChanges(), and SwitchToBranch().
|
overridevirtual |
Implements GIT_BACKEND.
Definition at line 1365 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 108 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 1818 of file libgit_backend.cpp.
References fetchRemote().
|
overridevirtual |
Implements GIT_BACKEND.
Definition at line 2047 of file libgit_backend.cpp.
References _, KIGIT_ERRORS::AddErrorString(), KIGIT_ERRORS::AddGitError(), adoptRemoteHistory(), KIGIT::BusyMessage(), KIGIT_REPO_MIXIN::CancelToken(), config, Error, fetchhead_foreach_cb(), fetchRemote(), KIGIT_REPO_MIXIN::GetActionLock(), KIGIT_REPO_MIXIN::GetCommon(), KIGIT_COMMON::GetRemoteNameOrDefault(), KIGIT_REPO_MIXIN::GetRepo(), handleFastForward(), handleMerge(), handleRebase(), KIGIT_REPO_MIXIN::IsThisOperationCancelled(), KIGIT::PROJECT_GIT_UTILS::ProjectUsesGitLfs(), result, Success, traceGit, and UpToDate.
|
overridevirtual |
Implements GIT_BACKEND.
Definition at line 1043 of file libgit_backend.cpp.
References _, KIGIT_ERRORS::AddErrorString(), Busy, KIGIT_REPO_MIXIN::CancelToken(), KIGIT::REMOTE_TRANSPORT::Error(), Error, KIGIT_REPO_MIXIN::GetActionLock(), KIGIT_REPO_MIXIN::GetCommon(), KIGIT_COMMON::GetRemoteNameOrDefault(), KIGIT_REPO_MIXIN::GetRepo(), GIT_PUSH_HANDLER::HasExpectedDestination(), GIT_PUSH_HANDLER::HasExpectedTarget(), KIGIT_REPO_MIXIN::IsThisOperationCancelled(), GIT_PUSH_HANDLER::MatchesExpectedDestination(), GIT_PUSH_HANDLER::MatchesExpectedTarget(), NonFastForward, PUSH, KIGIT::REMOTE_TRANSPORT::Push(), reportRemoteLookupFailure(), KIGIT_REPO_MIXIN::ReportTransferFailure(), Success, KIGIT_COMMON::SyncRemoteUrl(), and traceGit.
|
overridevirtual |
Implements GIT_BACKEND.
Definition at line 2992 of file libgit_backend.cpp.
References git_repository.
|
overridevirtual |
Implements GIT_BACKEND.
Definition at line 4130 of file libgit_backend.cpp.
References git_repository, RmDirRecursive(), and traceGit.
|
overridevirtual |
Implements GIT_BACKEND.
Definition at line 3323 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 2983 of file libgit_backend.cpp.
References git_repository.
|
overridevirtual |
Implements GIT_BACKEND.
Definition at line 1459 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 3001 of file libgit_backend.cpp.
References config, and git_repository.
|
overridevirtual |
Implements GIT_BACKEND.
Definition at line 81 of file libgit_backend.cpp.
References GIT_BACKEND::m_orphanRegistry, and traceGit.
|
overridevirtual |
Implements GIT_BACKEND.
Definition at line 2887 of file libgit_backend.cpp.
References applyStashOntoCleanTree(), and git_repository.
|
overridevirtual |
Implements GIT_BACKEND.
Definition at line 2899 of file libgit_backend.cpp.
References git_repository.
|
overridevirtual |
Implements GIT_BACKEND.
Definition at line 2893 of file libgit_backend.cpp.
References applyStashOntoCleanTree(), and git_repository.
|
overridevirtual |
Implements GIT_BACKEND.
Definition at line 2797 of file libgit_backend.cpp.
References git_repository, index, and message.
|
overridevirtual |
Implements GIT_BACKEND.
Definition at line 1524 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 |
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.
|
overridevirtual |
Implements GIT_BACKEND.
Definition at line 1290 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 202 of file git_backend.h.
Referenced by OrphanRegistry(), and LIBGIT_BACKEND::Shutdown().