|
KiCad PCB EDA Suite
|
Build a temp directory tree containing a local working repo with one commit and a bare "remote" repo cloned from it. More...
Public Member Functions | |
| GIT_BACKEND_FIXTURE () | |
| bool | ready () const |
| const wxString & | repoPath () const |
| const wxString & | tempBase () const |
| const wxString & | remotePath () const |
| git_repository * | openRepo () const |
| Open the working repo. Caller frees with git_repository_free. | |
| git_oid | createCommit (git_repository *aRepo, const wxString &aFile, const wxString &aContent, const wxString &aMessage) |
| Create a new commit on the current branch from a single (path, content) pair. | |
| git_oid | createDetachedCommit (git_repository *aRepo, const git_oid &aParentOid, const wxString &aFile, const std::string &aContent, const char *aMessage) |
| Create a commit on top of aParentOid setting aFile to aContent, without moving HEAD. | |
| void | writeFetchHead (const git_oid &aOid) |
| Write .git/FETCH_HEAD naming aOid, as a fetch would leave it. | |
| bool | addOrigin (git_repository *aRepo) |
Add an origin remote pointing at the bare remote on disk. | |
| bool | clearUpstreamConfig (git_repository *aRepo, const wxString &aBranch) |
| Drop branch. | |
| bool | setUpstreamConfig (git_repository *aRepo, const wxString &aBranch) |
| Set branch.<aBranch>.merge = refs/heads/<aBranch>, branch.<aBranch>.remote = origin. | |
| wxString | readConfig (git_repository *aRepo, const wxString &aKey) |
| Read a string value from the repo config, or "" if absent. | |
| void | useEmptyGlobalIgnore (git_repository *aRepo) |
| const wxString & | TempPath () const |
| LIBGIT_BACKEND * | Backend () const |
Private Member Functions | |
| bool | initRepoWithCommit () |
| bool | initBareRemoteFromRepo () |
Static Private Member Functions | |
| static wxString | toWxString (const std::filesystem::path &aPath) |
Private Attributes | |
| wxString | m_repoPath |
| wxString | m_remotePath |
| bool | m_ready |
| SCOPED_GIT_BACKEND | m_backend |
| SCOPED_TEMP_DIR | m_tempDir |
| SCOPED_TEMP_DIR | m_configDir |
| SCOPED_GIT_CONFIG_SEARCH_PATH | m_configSearchPath |
| wxString | m_tempPath |
Build a temp directory tree containing a local working repo with one commit and a bare "remote" repo cloned from it.
Helpers let individual tests mutate this state (additional commits, upstream config, amends, etc.).
Definition at line 76 of file test_libgit_backend.cpp.
|
inline |
Definition at line 78 of file test_libgit_backend.cpp.
References initBareRemoteFromRepo(), initRepoWithCommit(), m_ready, m_remotePath, m_repoPath, and KI_TEST::GIT_TEST_FIXTURE::TempPath().
|
inline |
Add an origin remote pointing at the bare remote on disk.
Definition at line 165 of file test_libgit_backend.cpp.
References git_repository, and m_remotePath.
|
inlineinherited |
Definition at line 97 of file git_test_fixture.h.
References m_backend.
|
inline |
Drop branch.
<aBranch>.merge / .remote, simulating a repo where Add Version Control wired up origin but never set per-branch upstream tracking.
Definition at line 179 of file test_libgit_backend.cpp.
References git_repository.
|
inline |
Create a new commit on the current branch from a single (path, content) pair.
Definition at line 102 of file test_libgit_backend.cpp.
References KI_TEST::CommitGitFile(), git_repository, m_repoPath, and KI_TEST::WriteGitFile().
Referenced by initRepoWithCommit().
|
inline |
Create a commit on top of aParentOid setting aFile to aContent, without moving HEAD.
Definition at line 111 of file test_libgit_backend.cpp.
References git_repository, result, TEST_AUTHOR_EMAIL, and TEST_AUTHOR_NAME.
|
inlineprivate |
Definition at line 263 of file test_libgit_backend.cpp.
References git_repository, m_remotePath, and m_repoPath.
Referenced by GIT_BACKEND_FIXTURE().
|
inlineprivate |
Definition at line 248 of file test_libgit_backend.cpp.
References config, createCommit(), KI_TEST::InitGitRepository(), m_repoPath, TEST_AUTHOR_EMAIL, and TEST_AUTHOR_NAME.
Referenced by GIT_BACKEND_FIXTURE().
|
inline |
Open the working repo. Caller frees with git_repository_free.
Definition at line 93 of file test_libgit_backend.cpp.
References git_repository, and m_repoPath.
|
inline |
Read a string value from the repo config, or "" if absent.
Definition at line 217 of file test_libgit_backend.cpp.
References git_repository, and result.
|
inline |
Definition at line 86 of file test_libgit_backend.cpp.
References m_ready.
|
inline |
Definition at line 89 of file test_libgit_backend.cpp.
References m_remotePath.
|
inline |
Definition at line 87 of file test_libgit_backend.cpp.
References m_repoPath.
Referenced by writeFetchHead().
|
inline |
Set branch.<aBranch>.merge = refs/heads/<aBranch>, branch.<aBranch>.remote = origin.
Definition at line 198 of file test_libgit_backend.cpp.
References git_repository.
|
inline |
Definition at line 88 of file test_libgit_backend.cpp.
References KI_TEST::GIT_TEST_FIXTURE::TempPath().
Referenced by useEmptyGlobalIgnore().
|
inlineinherited |
Definition at line 96 of file git_test_fixture.h.
References m_tempPath.
Referenced by GIT_BACKEND_FIXTURE::GIT_BACKEND_FIXTURE(), GIT_COMPARE_FIXTURE::GIT_COMPARE_FIXTURE(), GIT_BACKEND_FIXTURE::tempBase(), VCS_TEST_FIXTURE::tempDir(), and VCS_TEST_FIXTURE::VCS_TEST_FIXTURE().
|
inlinestaticprivateinherited |
Definition at line 100 of file git_test_fixture.h.
Referenced by GIT_TEST_FIXTURE().
|
inline |
Definition at line 236 of file test_libgit_backend.cpp.
References config, git_repository, path, tempBase(), and KI_TEST::WriteGitFile().
|
inline |
Write .git/FETCH_HEAD naming aOid, as a fetch would leave it.
Definition at line 153 of file test_libgit_backend.cpp.
References repoPath().
|
privateinherited |
Definition at line 110 of file git_test_fixture.h.
Referenced by Backend().
|
privateinherited |
Definition at line 112 of file git_test_fixture.h.
Referenced by GIT_TEST_FIXTURE().
|
privateinherited |
Definition at line 113 of file git_test_fixture.h.
Referenced by GIT_TEST_FIXTURE().
|
private |
Definition at line 281 of file test_libgit_backend.cpp.
Referenced by GIT_BACKEND_FIXTURE(), and ready().
|
private |
Definition at line 280 of file test_libgit_backend.cpp.
Referenced by addOrigin(), GIT_BACKEND_FIXTURE(), initBareRemoteFromRepo(), and remotePath().
|
private |
Definition at line 279 of file test_libgit_backend.cpp.
Referenced by createCommit(), GIT_BACKEND_FIXTURE(), initBareRemoteFromRepo(), initRepoWithCommit(), openRepo(), and repoPath().
|
privateinherited |
Definition at line 111 of file git_test_fixture.h.
Referenced by GIT_TEST_FIXTURE().
|
privateinherited |
Definition at line 114 of file git_test_fixture.h.
Referenced by GIT_TEST_FIXTURE(), and TempPath().