|
KiCad PCB EDA Suite
|
#include "libgit_backend.h"#include "git_clone_handler.h"#include "git_commit_handler.h"#include "git_push_handler.h"#include "git_status_handler.h"#include "git_config_handler.h"#include "git_init_handler.h"#include "git_branch_handler.h"#include "git_pull_handler.h"#include "project_git_utils.h"#include "kicad_git_common.h"#include "kicad_git_memory.h"#include "kigit_failure.h"#include "trace_helpers.h"#include "kicad_git_compat.h"#include <wx/file.h>#include <wx/filename.h>#include <wx/log.h>#include <gestfich.h>#include <algorithm>#include <fstream>#include <iterator>#include <map>#include <memory>#include <optional>#include <set>#include <string>#include <vector>Go to the source code of this file.
Classes | |
| struct | SELECTED_STATE |
| struct | STAGED_ENTRY |
| struct | SCRATCH_INDEX_GUARD |
| struct | COMMIT_STAGING |
Enumerations | |
| enum class | REPUBLISH_RESULT { UPDATED , CHANGED_EXTERNALLY , WRITE_FAILED } |
| enum class | TREE_STATE { CLEAN , DIRTY , UNKNOWN } |
| enum class | PUBLISH_RESULT { PUBLISHED , CHECKOUT_FAILED_ROLLED_BACK , CHECKOUT_FAILED_PARTIAL , RECORD_FAILED_ROLLED_BACK , RECORD_FAILED_PARTIAL } |
Functions | |
| static KIGIT_ERROR_MESSAGE | describeSignatureFailure (int aRc) |
| static void | reportRemoteLookupFailure (KIGIT_ERRORS *aHandler, int aRc, const wxString &aRemoteName) |
| static int | clone_remote_cb (git_remote **aOut, git_repository *aRepo, const char *aName, const char *aUrl, void *aPayload) |
| static std::map< std::string, SELECTED_STATE > | readSelectedState (git_index *aIndex, const std::set< std::string > &aSelected) |
| static std::map< std::string, SELECTED_STATE > | readWholeState (git_index *aIndex) |
| static git_index * | openIndexOnDisk (git_index *aRepoIndex) |
| static bool | selectedStateOnDisk (git_index *aRepoIndex, const std::set< std::string > &aSelected, std::map< std::string, SELECTED_STATE > &aOut) |
| static bool | wholeStateOnDisk (git_index *aRepoIndex, std::map< std::string, SELECTED_STATE > &aOut) |
| static bool | applySelectedPaths (git_repository *aRepo, git_index *aIndex, const std::vector< wxString > &aFiles) |
| static bool | branchMovedSince (git_repository *aRepo, const git_oid &aHeadAtStart, bool aHadHead) |
| static bool | selectedPathsRestaged (git_index *aIndex, const std::set< std::string > &aSelected, const std::map< std::string, SELECTED_STATE > &aAtStart) |
| static bool | indexChangedSince (git_index *aIndex, const std::map< std::string, SELECTED_STATE > &aAtStart) |
| static REPUBLISH_RESULT | republishIndex (git_index *aIndex, const std::vector< STAGED_ENTRY > &aCommitted, const std::set< std::string > &aSelected) |
| static bool | refuseWhileOperationInProgress (git_repository *aRepo, git_index *aIndex, wxString &aError) |
| static int | lookup_branch_reference (git_repository *repo, const wxString &aBranchName, git_reference **aReference) |
| static bool | rollbackWorkingTree (git_repository *aRepo, git_commit *aHeadCommit, git_tree *aWrittenTree) |
| static bool | restorePathsFromCommit (git_repository *aRepo, git_commit *aCommit, const std::vector< std::string > &aPaths) |
| static void | refreshCachedIndex (git_repository *aRepo) |
| static std::vector< std::string > | changedPaths (git_repository *aRepo) |
| static TREE_STATE | trackedTreeState (git_repository *aRepo) |
| static bool | untrackedFilesOverwrittenBy (git_repository *aRepo, git_tree *aIncomingTree, std::vector< wxString > &aCollisions) |
| static wxString | describeUntrackedCollisions (const std::vector< wxString > &aPaths) |
| static PullResult | adoptRemoteHistory (GIT_PULL_HANDLER *aHandler, const git_oid &aRemoteOid) |
| static PullResult | rebaseOnto (GIT_PULL_HANDLER *aHandler, git_repository *aRepo, const git_annotated_commit *aOnto) |
| static bool | applyStashOntoCleanTree (git_repository *aRepo, size_t aIndex) |
| static bool | treeHolds (git_tree *aTree, const char *aPath, const git_oid &aOnDisk) |
| static bool | safeToRestore (git_repository *aRepo, const char *aPath, git_tree *aPreviousTree, git_tree *aWrittenTree) |
| static PUBLISH_RESULT | publishPreparedCommit (git_repository *aRepo, git_tree *aTree, const git_oid &aCommitOid, git_reference *aHeadRef, git_commit *aRollbackCommit, const char *aReflogLabel, wxString &aGitError) |
|
strong |
| Enumerator | |
|---|---|
| PUBLISHED | |
| CHECKOUT_FAILED_ROLLED_BACK | |
| CHECKOUT_FAILED_PARTIAL | |
| RECORD_FAILED_ROLLED_BACK | |
| RECORD_FAILED_PARTIAL | |
Definition at line 2954 of file libgit_backend.cpp.
|
strong |
| Enumerator | |
|---|---|
| UPDATED | |
| CHANGED_EXTERNALLY | |
| WRITE_FAILED | |
Definition at line 408 of file libgit_backend.cpp.
|
strong |
| Enumerator | |
|---|---|
| CLEAN | |
| DIRTY | |
| UNKNOWN | |
Definition at line 1536 of file libgit_backend.cpp.
|
static |
Definition at line 1646 of file libgit_backend.cpp.
References _, KIGIT_ERRORS::AddError(), KIGIT_ERRORS::AddErrorString(), KIGIT_ERRORS::AddGitError(), describeUntrackedCollisions(), DirtyWorkdir, Error, FastForward, KIGIT_REPO_MIXIN::GetCommon(), KIGIT_COMMON::GetLastGitError(), KIGIT_COMMON::GetRemoteNameOrDefault(), KIGIT_REPO_MIXIN::GetRepo(), git_repository, refreshCachedIndex(), and untrackedFilesOverwrittenBy().
Referenced by LIBGIT_BACKEND::PerformPull().
|
static |
Definition at line 353 of file libgit_backend.cpp.
References git_repository, and path.
Referenced by COMMIT_STAGING::BuildTree().
|
static |
Definition at line 2516 of file libgit_backend.cpp.
References _, changedPaths(), CLEAN, git_repository, index, restorePathsFromCommit(), and trackedTreeState().
Referenced by LIBGIT_BACKEND::StashApply(), and LIBGIT_BACKEND::StashPop().
|
static |
Definition at line 380 of file libgit_backend.cpp.
References git_repository.
Referenced by COMMIT_STAGING::BuildTree().
|
static |
Definition at line 1545 of file libgit_backend.cpp.
References git_repository.
Referenced by applyStashOntoCleanTree(), and ShowGitCommitDiff().
|
static |
Definition at line 143 of file libgit_backend.cpp.
References git_repository.
Referenced by LIBGIT_BACKEND::Clone().
|
static |
Definition at line 116 of file libgit_backend.cpp.
References _, and KIGIT_COMMON::GetLastGitError().
Referenced by LIBGIT_BACKEND::CreateMergedCommit(), LIBGIT_BACKEND::handleMerge(), rebaseOnto(), and LIBGIT_BACKEND::RestoreVersion().
|
static |
Definition at line 1632 of file libgit_backend.cpp.
Referenced by adoptRemoteHistory(), LIBGIT_BACKEND::handleFastForward(), and LIBGIT_BACKEND::handleMerge().
|
static |
Definition at line 400 of file libgit_backend.cpp.
References wholeStateOnDisk().
Referenced by LIBGIT_BACKEND::Amend(), COMMIT_STAGING::BuildTree(), and LIBGIT_BACKEND::Commit().
|
static |
Definition at line 1301 of file libgit_backend.cpp.
References git_repository.
Referenced by LIBGIT_BACKEND::SwitchToBranch().
|
static |
Definition at line 277 of file libgit_backend.cpp.
Referenced by selectedStateOnDisk(), and wholeStateOnDisk().
|
static |
Definition at line 2965 of file libgit_backend.cpp.
References CHECKOUT_FAILED_PARTIAL, CHECKOUT_FAILED_ROLLED_BACK, KIGIT_COMMON::GetLastGitError(), git_repository, PUBLISHED, RECORD_FAILED_PARTIAL, RECORD_FAILED_ROLLED_BACK, refreshCachedIndex(), and rollbackWorkingTree().
Referenced by LIBGIT_BACKEND::CreateMergedCommit(), and LIBGIT_BACKEND::RestoreVersion().
|
static |
Definition at line 232 of file libgit_backend.cpp.
References SELECTED_STATE::id, SELECTED_STATE::mode, path, SELECTED_STATE::present, and result.
Referenced by COMMIT_STAGING::Begin(), and selectedStateOnDisk().
|
static |
Definition at line 255 of file libgit_backend.cpp.
References SELECTED_STATE::id, SELECTED_STATE::mode, SELECTED_STATE::present, and result.
Referenced by republishIndex(), and wholeStateOnDisk().
|
static |
Definition at line 2303 of file libgit_backend.cpp.
References _, KIGIT_ERRORS::AddError(), KIGIT_ERRORS::AddErrorString(), KIGIT_ERRORS::AddGitError(), Conflict, describeSignatureFailure(), Error, KIGIT_COMMON::GetLastGitError(), git_repository, and Success.
Referenced by LIBGIT_BACKEND::handleRebase().
|
static |
Definition at line 1524 of file libgit_backend.cpp.
References git_repository, and index.
Referenced by adoptRemoteHistory(), LIBGIT_BACKEND::handleFastForward(), and publishPreparedCommit().
|
static |
Definition at line 458 of file libgit_backend.cpp.
References _, and git_repository.
Referenced by COMMIT_STAGING::Begin().
|
static |
Definition at line 125 of file libgit_backend.cpp.
References _, KIGIT_ERRORS::AddError(), and KIGIT_COMMON::GetLastGitError().
Referenced by LIBGIT_BACKEND::PerformFetch(), and LIBGIT_BACKEND::Push().
|
static |
Definition at line 417 of file libgit_backend.cpp.
References CHANGED_EXTERNALLY, path, readWholeState(), UPDATED, wholeStateOnDisk(), and WRITE_FAILED.
Referenced by LIBGIT_BACKEND::Amend(), and LIBGIT_BACKEND::Commit().
|
static |
Definition at line 2840 of file libgit_backend.cpp.
References git_repository, and path.
Referenced by applyStashOntoCleanTree(), and rollbackWorkingTree().
|
static |
Definition at line 2905 of file libgit_backend.cpp.
References delta, git_repository, path, restorePathsFromCommit(), and safeToRestore().
Referenced by LIBGIT_BACKEND::handleFastForward(), and publishPreparedCommit().
|
static |
Definition at line 2882 of file libgit_backend.cpp.
References git_repository, and treeHolds().
Referenced by rollbackWorkingTree().
|
static |
Definition at line 390 of file libgit_backend.cpp.
References selectedStateOnDisk().
Referenced by LIBGIT_BACKEND::Amend(), COMMIT_STAGING::BuildTree(), and LIBGIT_BACKEND::Commit().
|
static |
Definition at line 302 of file libgit_backend.cpp.
References openIndexOnDisk(), and readSelectedState().
Referenced by selectedPathsRestaged().
|
static |
Definition at line 1576 of file libgit_backend.cpp.
References CLEAN, DIRTY, git_repository, and UNKNOWN.
Referenced by applyStashOntoCleanTree(), and LIBGIT_BACKEND::handleFastForward().
|
static |
Definition at line 2868 of file libgit_backend.cpp.
Referenced by safeToRestore().
|
static |
Definition at line 1594 of file libgit_backend.cpp.
References git_repository, and path.
Referenced by adoptRemoteHistory(), LIBGIT_BACKEND::handleFastForward(), and LIBGIT_BACKEND::handleMerge().
|
static |
Definition at line 316 of file libgit_backend.cpp.
References openIndexOnDisk(), and readWholeState().
Referenced by COMMIT_STAGING::Begin(), indexChangedSince(), and republishIndex().