build: Don't check parent directories for git tag

Sometimes Zig is built not from a git repository (e.g. from tarball), but inside another git repository (e.g. distro package repository). Make sure that the version check tries to parse a tag of Zig, and not of a parent directory.
This commit is contained in:
LN Liberda 2025-03-07 18:20:46 +01:00 committed by Linus Groh
parent 3b3c18909d
commit 21620f3c65

View file

@ -259,6 +259,8 @@ pub fn build(b: *std.Build) !void {
"git", "git",
"-C", "-C",
b.build_root.path orelse ".", b.build_root.path orelse ".",
"--git-dir",
".git",
"describe", "describe",
"--match", "--match",
"*.*.*", "*.*.*",