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 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 34 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 59 of file project_git_utils.cpp.
References KIGIT_COMMON::GetLastGitError(), and traceGit.
Referenced by PROJECT_TREE_PANE::onGitSwitchBranch().
|
static |
Discover and open the repository that contains the given file.
aFilename | Absolute path to a file inside the repository. |
Definition at line 35 of file project_git_utils.cpp.
References KIGIT_COMMON::GetLastGitError(), GIT_BUF_INIT, and traceGit.
Referenced by 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 93 of file project_git_utils.cpp.
References RmDirRecursive(), and traceGit.
Referenced by PROJECT_TREE_PANE::EmptyTreePrj(), PROJECT_TREE_PANE::onGitRemoveVCS(), and PROJECT_TREE_PANE::ReCreateTreePrj().