KiCad PCB EDA Suite
Loading...
Searching...
No Matches
GIT_COMPARE_FIXTURE Struct Reference

Build a temp working repo with two commits. More...

Public Member Functions

 GIT_COMPARE_FIXTURE ()
 
 ~GIT_COMPARE_FIXTURE ()
 
void writeFile (const wxString &aFile, const wxString &aContent)
 Write a file in the working tree (or remove it if aRemove is set).
 
void removeFile (const wxString &aFile)
 
bool commitAll (const wxString &aMessage)
 Stage every change (including deletions) and create a commit on HEAD.
 
git_repository * repo () const
 
bool ready () const
 

Private Member Functions

bool initRepo ()
 

Private Attributes

git_repository * m_repo
 
wxString m_repoPath
 
bool m_ready
 

Static Private Attributes

static long s_counter = 0
 

Detailed Description

Build a temp working repo with two commits.

The first commit adds a.txt and b.txt; the second modifies a.txt, deletes b.txt and adds c.txt. This lets a compare of HEAD~1..HEAD exercise modified / removed / added deltas.

Definition at line 52 of file test_git_compare_handler.cpp.

Constructor & Destructor Documentation

◆ GIT_COMPARE_FIXTURE()

GIT_COMPARE_FIXTURE::GIT_COMPARE_FIXTURE ( )
inline

Definition at line 54 of file test_git_compare_handler.cpp.

References initRepo(), m_ready, m_repo, m_repoPath, and s_counter.

◆ ~GIT_COMPARE_FIXTURE()

GIT_COMPARE_FIXTURE::~GIT_COMPARE_FIXTURE ( )
inline

Definition at line 72 of file test_git_compare_handler.cpp.

References m_repo, and m_repoPath.

Member Function Documentation

◆ commitAll()

bool GIT_COMPARE_FIXTURE::commitAll ( const wxString & aMessage)
inline

Stage every change (including deletions) and create a commit on HEAD.

Definition at line 100 of file test_git_compare_handler.cpp.

References index, m_repo, TEST_AUTHOR_EMAIL, and TEST_AUTHOR_NAME.

Referenced by initRepo().

◆ initRepo()

bool GIT_COMPARE_FIXTURE::initRepo ( )
inlineprivate

◆ ready()

bool GIT_COMPARE_FIXTURE::ready ( ) const
inline

Definition at line 157 of file test_git_compare_handler.cpp.

References m_ready.

◆ removeFile()

void GIT_COMPARE_FIXTURE::removeFile ( const wxString & aFile)
inline

Definition at line 93 of file test_git_compare_handler.cpp.

References m_repoPath.

Referenced by initRepo().

◆ repo()

git_repository * GIT_COMPARE_FIXTURE::repo ( ) const
inline

Definition at line 156 of file test_git_compare_handler.cpp.

References m_repo.

◆ writeFile()

void GIT_COMPARE_FIXTURE::writeFile ( const wxString & aFile,
const wxString & aContent )
inline

Write a file in the working tree (or remove it if aRemove is set).

Definition at line 85 of file test_git_compare_handler.cpp.

References m_repoPath.

Referenced by initRepo().

Member Data Documentation

◆ m_ready

bool GIT_COMPARE_FIXTURE::m_ready
private

Definition at line 197 of file test_git_compare_handler.cpp.

Referenced by GIT_COMPARE_FIXTURE(), and ready().

◆ m_repo

git_repository* GIT_COMPARE_FIXTURE::m_repo
private

◆ m_repoPath

wxString GIT_COMPARE_FIXTURE::m_repoPath
private

◆ s_counter

long GIT_COMPARE_FIXTURE::s_counter = 0
staticprivate

Definition at line 199 of file test_git_compare_handler.cpp.

Referenced by GIT_COMPARE_FIXTURE().


The documentation for this struct was generated from the following file: