|
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 () | |
| ~GIT_BACKEND_FIXTURE () | |
| bool | ready () const |
| const wxString & | repoPath () 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. | |
| 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. | |
Private Member Functions | |
| bool | initRepoWithCommit () |
| bool | initBareRemoteFromRepo () |
Private Attributes | |
| LIBGIT_BACKEND * | m_backend |
| wxString | m_tempBase |
| wxString | m_repoPath |
| wxString | m_remotePath |
| bool | m_ready |
Static Private Attributes | |
| static long | s_counter = 0 |
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 57 of file test_libgit_backend.cpp.
|
inline |
Definition at line 59 of file test_libgit_backend.cpp.
References initBareRemoteFromRepo(), initRepoWithCommit(), m_backend, m_ready, m_remotePath, m_repoPath, m_tempBase, s_counter, and SetGitBackend().
|
inline |
Definition at line 78 of file test_libgit_backend.cpp.
References m_backend, m_tempBase, and SetGitBackend().
|
inline |
Add an origin remote pointing at the bare remote on disk.
Definition at line 163 of file test_libgit_backend.cpp.
References m_remotePath.
|
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 178 of file test_libgit_backend.cpp.
|
inline |
Create a new commit on the current branch from a single (path, content) pair.
Definition at line 104 of file test_libgit_backend.cpp.
References index, m_repoPath, TEST_AUTHOR_EMAIL, and TEST_AUTHOR_NAME.
Referenced by initRepoWithCommit().
|
inlineprivate |
Definition at line 258 of file test_libgit_backend.cpp.
References m_remotePath, and m_repoPath.
Referenced by GIT_BACKEND_FIXTURE().
|
inlineprivate |
Definition at line 236 of file test_libgit_backend.cpp.
References createCommit(), 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 95 of file test_libgit_backend.cpp.
References m_repoPath.
|
inline |
Read a string value from the repo config, or "" if absent.
Definition at line 216 of file test_libgit_backend.cpp.
References result.
|
inline |
Definition at line 89 of file test_libgit_backend.cpp.
References m_ready.
|
inline |
Definition at line 91 of file test_libgit_backend.cpp.
References m_remotePath.
|
inline |
Definition at line 90 of file test_libgit_backend.cpp.
References m_repoPath.
|
inline |
Set branch.<aBranch>.merge = refs/heads/<aBranch>, branch.<aBranch>.remote = origin.
Definition at line 197 of file test_libgit_backend.cpp.
|
private |
Definition at line 276 of file test_libgit_backend.cpp.
Referenced by GIT_BACKEND_FIXTURE(), and ~GIT_BACKEND_FIXTURE().
|
private |
Definition at line 280 of file test_libgit_backend.cpp.
Referenced by GIT_BACKEND_FIXTURE(), and ready().
|
private |
Definition at line 279 of file test_libgit_backend.cpp.
Referenced by addOrigin(), GIT_BACKEND_FIXTURE(), initBareRemoteFromRepo(), and remotePath().
|
private |
Definition at line 278 of file test_libgit_backend.cpp.
Referenced by createCommit(), GIT_BACKEND_FIXTURE(), initBareRemoteFromRepo(), initRepoWithCommit(), openRepo(), and repoPath().
|
private |
Definition at line 277 of file test_libgit_backend.cpp.
Referenced by GIT_BACKEND_FIXTURE(), and ~GIT_BACKEND_FIXTURE().
|
staticprivate |
Definition at line 282 of file test_libgit_backend.cpp.
Referenced by GIT_BACKEND_FIXTURE().