| 
    KiCad PCB EDA Suite
    
   | 
 
Utility class with helper functions for project level git operations. More...
#include <project_git_utils.h>
Static Public Member Functions | |
| static git_repository * | GetRepositoryForFile (const char *aFilename) | 
| Discover and open the repository that contains the given file.   | |
| static int | CreateBranch (git_repository *aRepo, const wxString &aBranchName) | 
| Create a new branch based on HEAD.   | |
| static wxString | GetCurrentHash (const wxString &aProjectFile, bool aShort) | 
| Return the current HEAD commit hash for the repository containing aProjectFile.   | |
| static bool | RemoveVCS (git_repository *&aRepo, const wxString &aProjectPath=wxEmptyString, bool aRemoveGitDir=false, wxString *aErrors=nullptr) | 
| Remove version control from a directory by freeing the repository and optionally removing the .git directory.   | |
Utility class with helper functions for project level git operations.
Definition at line 35 of file project_git_utils.h.
      
  | 
  static | 
Create a new branch based on HEAD.
| aRepo | Repository in which to create the branch. | 
| aBranchName | Name of the new branch. | 
Definition at line 38 of file project_git_utils.cpp.
References GIT_BACKEND::CreateBranch(), and GetGitBackend().
Referenced by PROJECT_TREE_PANE::onGitSwitchBranch().
      
  | 
  static | 
Return the current HEAD commit hash for the repository containing aProjectFile.
| aProjectFile | Absolute path to any file within the repository (typically the project file path). | 
| aShort | If true, return the short (8 char) hash, otherwise full hash. | 
Definition at line 49 of file project_git_utils.cpp.
References GetRepositoryForFile(), result, and TO_UTF8.
Referenced by PROJECT::TextVarResolver().
      
  | 
  static | 
Discover and open the repository that contains the given file.
| aFilename | Absolute path to a file inside the repository. | 
Definition at line 33 of file project_git_utils.cpp.
References GetGitBackend(), and GIT_BACKEND::GetRepositoryForFile().
Referenced by GetCurrentHash(), and PROJECT_TREE_PANE::ReCreateTreePrj().
      
  | 
  static | 
Remove version control from a directory by freeing the repository and optionally removing the .git directory.
| aRepo | Repository to free (will be set to nullptr) | 
| aProjectPath | Path to the project directory | 
| aRemoveGitDir | If true, also remove the .git directory from disk | 
| aErrors | Output parameter for any error messages | 
Definition at line 43 of file project_git_utils.cpp.
References GetGitBackend(), and GIT_BACKEND::RemoveVCS().
Referenced by PROJECT_TREE_PANE::EmptyTreePrj(), PROJECT_TREE_PANE::onGitRemoveVCS(), and PROJECT_TREE_PANE::ReCreateTreePrj().