]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
git: Fix check for whether we're in a git repo
authorArran Cudbard-Bell <a.cudbardb@freeradius.org>
Fri, 7 Apr 2023 03:11:34 +0000 (20:11 -0700)
committerArran Cudbard-Bell <a.cudbardb@freeradius.org>
Fri, 7 Apr 2023 03:24:04 +0000 (20:24 -0700)
configure
configure.ac

index fe0757062adf2abec052e30c461443d7a90f12e6..dcafea3848d81f4e92c703c3b6266c54fee600e9 100755 (executable)
--- 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; }
index 5d5905ff7868c49e3fd6968513cb2402979e1b50..059bc532d5e12e97f11b94a071e6404c5af7322a 100644 (file)
@@ -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