Commit Graph

10 Commits

Author SHA1 Message Date
Seth Hillbrand 508bb36f8b Fix null dereference in PROJECT_GIT_UTILS
In CLI mode, SetGitBackend() is never called so GetGitBackend() returns
nullptr. GetRepositoryForFile(), CreateBranch(), and RemoveVCS() all
called GetGitBackend()->method() unconditionally, causing a SIGSEGV when
a schematic containing ${VCSHASH} or ${VCSSHORTHASH} text variables is
loaded via kicad-cli jobset run.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/23214
2026-03-02 08:03:53 -08:00
Wayne Stambaugh c19341dfe7 Coding policy fixes. 2026-02-04 11:38:42 -05:00
Seth Hillbrand 23765b6ebe Fix git status icons not showing when project opened via symlink
When a project is opened through a symlinked path, libgit2's
git_repository_workdir() returns the canonical path with symlinks
resolved. This caused a path mismatch between the tree cache
(which uses the user-provided symlinked path) and git status
results (which used canonical paths), preventing status icons
from being displayed.

The fix introduces SetProjectDir()/GetProjectDir() methods to
KIGIT_COMMON to store and use the user-provided project path.
A helper function computeSymlinkPreservingWorkDir() computes
the git working directory path while preserving symlinks from
the original user path.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/21092
2026-01-11 20:04:12 -08:00
Seth Hillbrand a603ad8041 Allow for 8 hex char + 1 nul char in VCSSHORTHASH 2025-10-08 00:51:05 -07:00
Seth Hillbrand c64f99c57a ADDED: VCSHASH and VCSSHORTHASH
Right now, git hashes only resolved by the variables ${VCSHASH} or
${VCSSHORTHASH}
2025-09-12 06:00:27 -07:00
Seth Hillbrand aac15f4596 Encapsulate libgit commands into single backend
Sets stage for allowing alternate backends for version control
2025-09-08 21:04:31 -07:00
Seth Hillbrand 11f9817ebc Fix compile issue for Ubuntu
Thanks dnschneid!
2025-08-23 12:05:05 -07:00
Seth Hillbrand f2b6ac5d18 Refactor git calls into their own namespace 2025-07-31 08:32:07 -07:00
Seth Hillbrand 7af404af43 Fix improper boolean check
This was assigning a boolean 1 or 0 to the error instead of the git
error code
2025-07-31 08:32:06 -07:00
Seth Hillbrand 2aad11e3e7 Refactor some git routines into utility class 2025-07-30 16:59:41 -07:00