build: pass --abbrev to git rather than relying on global config

For computing the zig version number, pass --abbrev=9 rather than
requiring the user to set their git configuration in order to make zig
versions match the standard.
This commit is contained in:
Andrew Kelley
2023-12-18 14:43:07 -07:00
parent 90a19f7411
commit f545fc28b3
12 changed files with 9 additions and 12 deletions

View File

@@ -23,7 +23,6 @@ function CheckLastExitCode {
# Make the `zig version` number consistent.
# This will affect the `zig build` command below which uses `git describe`.
git config core.abbrev 9
git fetch --tags
if ((git rev-parse --is-shallow-repository) -eq "true") {