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; }
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`
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