configure.ac: make the GIT_COMMIT command worktree-safe

`$srcdir/.git` doesn't exist if `$srcdir` is a worktree.
This commit is contained in:
Max Kellermann 2018-08-17 19:50:32 +02:00
parent 12bc625fe1
commit ddc85c620f

View File

@ -16,7 +16,7 @@ AC_CONFIG_MACRO_DIR([m4])
AC_DEFINE(PROTOCOL_VERSION, "0.20.0", [The MPD protocol version])
GIT_COMMIT=`GIT_DIR="$srcdir/.git" git describe --dirty --always 2>/dev/null`
GIT_COMMIT=`cd "$srcdir" && git describe --dirty --always 2>/dev/null`
if test x$GIT_COMMIT != x; then
AC_DEFINE_UNQUOTED(GIT_COMMIT, ["$GIT_COMMIT"], [The current git commit])
fi