mirror of
https://github.com/azahar-emu/azahar.git
synced 2026-11-11 16:49:39 +01:00
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.