From: Arran Cudbard-Bell Date: Fri, 7 Apr 2023 03:11:34 +0000 (-0700) Subject: git: Fix check for whether we're in a git repo X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b97ee714bf22e08aff4c405f8f33a97885fe0a6b;p=thirdparty%2Ffreeradius-server.git git: Fix check for whether we're in a git repo --- diff --git a/configure b/configure index fe0757062a..dcafea3848 100755 --- a/configure +++ b/configure @@ -3264,7 +3264,7 @@ then : fi -if test "x$GIT" = "xyes" && git status 2>&1 > /dev/null; then +if test "x$GIT" = "xyes" && git --git-dir=.git status 2>&1 > /dev/null; then if test "x$RADIUSD_VERSION_COMMIT" = "x"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking build commit" >&5 printf %s "checking build commit... " >&6; } diff --git a/configure.ac b/configure.ac index 5d5905ff78..059bc532d5 100644 --- a/configure.ac +++ b/configure.ac @@ -154,7 +154,12 @@ AC_ARG_ENABLE(developer, dnl # dnl # Turn on the developer flag when taken from a git checkout (not a release) dnl # -if test "x$GIT" = "xyes" && git status 2>&1 > /dev/null; then +dnl # Passing --git-dir explicitly limits the search to the CWD. Without it +dnl # git will search back up the directory tree for a git repository. +dnl # This can cause the configure script to erroneously determine that it's +dnl # running in a git repo. +dnl # +if test "x$GIT" = "xyes" && git --git-dir=.git status 2>&1 > /dev/null; then if test "x$RADIUSD_VERSION_COMMIT" = "x"; then AC_MSG_CHECKING([build commit]) RADIUSD_VERSION_COMMIT=`git rev-parse --short=8 HEAD` @@ -2645,8 +2650,8 @@ dnl # case "$target" in *-darwin*) echo "Please be sure to use 'xcrun gmake' or 'xcrun lldb' in order to build and run the server from the source tree" - ;; + ;; *) ;; -esac +esac