Files
azahar/CMakeModules
davey 16a93508b5 build: Report the real version in linked worktrees
Version detection is gated on .git/objects existing, which it does not in a
linked worktree, where .git is a file pointing at the common gitdir. Every
worktree build fell through to the self-packed-archive branch and was stamped
UNKNOWN, so the title bar read "azahar UNKNOWN" and the log reported
"UNKNOWN | UNKNOWN-UNKNOWN". Testing for .git itself covers both layouts; a
source tree with no .git at all still takes the archive branch.

That is enough for the branch name and the description, which shell out to git,
but not for the hash. get_git_head_revision() resolves HEAD by hand, and a
worktree keeps its own HEAD while the ref that HEAD names lives in the common
gitdir, which GetGitRevisionDescription.cmake does not follow. Fall back to git
rev-parse, which knows where to look. A normal checkout resolves the hash as
before and never reaches the fallback.
2026-10-15 22:23:04 +01:00
..
2018-11-20 14:24:19 -05:00