KiCad PCB EDA Suite
Loading...
Searching...
No Matches
GIT_DIFF_WORKSPACE Class Reference

A private scratch directory for extracting committed file versions to diff, removed when this object goes out of scope. More...

#include <git_status_entries.h>

Public Member Functions

 GIT_DIFF_WORKSPACE ()
 
 GIT_DIFF_WORKSPACE (const GIT_DIFF_WORKSPACE &)=delete
 
GIT_DIFF_WORKSPACE & operator= (const GIT_DIFF_WORKSPACE &)=delete
 
bool IsOk () const
 True when the scratch directory was created.
 
const wxString & Root () const
 The scratch directory, for callers that lay out their own files (e.g. footprint libraries).
 
wxString Materialize (git_repository *aRepo, const wxString &aRef, const wxString &aRelPath, KICAD_DIFF::DOC_KIND aKind)
 Extract aRelPath at aRef into a uniquely named slot and return the path to load, or an empty string when that version does not exist or could not be written.
 

Private Attributes

SCOPED_TEMP_PATH m_root
 
int m_slot = 0
 

Detailed Description

A private scratch directory for extracting committed file versions to diff, removed when this object goes out of scope.

A schematic checks out the whole tree so its sub-sheet files resolve. Other document kinds are written as a single blob.

Definition at line 44 of file git_status_entries.h.

Constructor & Destructor Documentation

◆ GIT_DIFF_WORKSPACE() [1/2]

GIT_DIFF_WORKSPACE::GIT_DIFF_WORKSPACE ( )

Definition at line 848 of file git_status_entries.cpp.

References m_root.

Referenced by GIT_DIFF_WORKSPACE(), and operator=().

◆ GIT_DIFF_WORKSPACE() [2/2]

GIT_DIFF_WORKSPACE::GIT_DIFF_WORKSPACE ( const GIT_DIFF_WORKSPACE & )
delete

References GIT_DIFF_WORKSPACE().

Member Function Documentation

◆ IsOk()

bool GIT_DIFF_WORKSPACE::IsOk ( ) const
inline

True when the scratch directory was created.

Definition at line 53 of file git_status_entries.h.

References m_root.

Referenced by BOOST_AUTO_TEST_CASE(), Materialize(), and DIALOG_GIT_MR_REVIEW::openFileDiff().

◆ Materialize()

wxString GIT_DIFF_WORKSPACE::Materialize ( git_repository * aRepo,
const wxString & aRef,
const wxString & aRelPath,
KICAD_DIFF::DOC_KIND aKind )

Extract aRelPath at aRef into a uniquely named slot and return the path to load, or an empty string when that version does not exist or could not be written.

Definition at line 854 of file git_status_entries.cpp.

References git_repository, IsOk(), m_slot, path, Root(), KICAD_DIFF::SCH, KIGIT::PROJECT_GIT_UTILS::WriteBlobToFile(), and KIGIT::PROJECT_GIT_UTILS::WriteTreeToDir().

Referenced by BOOST_AUTO_TEST_CASE(), MaterializeCommitFile(), MaterializeWorkingFile(), and DIALOG_GIT_MR_REVIEW::openFileDiff().

◆ operator=()

GIT_DIFF_WORKSPACE & GIT_DIFF_WORKSPACE::operator= ( const GIT_DIFF_WORKSPACE & )
delete

References GIT_DIFF_WORKSPACE().

◆ Root()

const wxString & GIT_DIFF_WORKSPACE::Root ( ) const
inline

The scratch directory, for callers that lay out their own files (e.g. footprint libraries).

Definition at line 56 of file git_status_entries.h.

References m_root.

Referenced by BOOST_AUTO_TEST_CASE(), GIT_COMMIT_PANE::finishPullConflictPreparation(), Materialize(), and DIALOG_GIT_MR_REVIEW::openFileDiff().

Member Data Documentation

◆ m_root

SCOPED_TEMP_PATH GIT_DIFF_WORKSPACE::m_root
private

Definition at line 64 of file git_status_entries.h.

Referenced by GIT_DIFF_WORKSPACE(), IsOk(), and Root().

◆ m_slot

int GIT_DIFF_WORKSPACE::m_slot = 0
private

Definition at line 65 of file git_status_entries.h.

Referenced by Materialize().


The documentation for this class was generated from the following files: