Fix Git commit ID detection in Git worktrees
authorSylvain Henry <hsyl20@gmail.com>
Sat, 28 Jul 2018 15:48:04 +0000 (17:48 +0200)
committerBen Gamari <ben@smart-cactus.org>
Tue, 31 Jul 2018 19:53:19 +0000 (15:53 -0400)
Summary: When using a Git worktree, ".git" is a file, not a directory

Reviewers: bgamari, monoidal

Reviewed By: monoidal

Subscribers: rwbarton, thomie, erikd, carter

Differential Revision: https://phabricator.haskell.org/D5016

(cherry picked from commit 3539561b24b78aee2b37280ddf6bb64e2db3a67d)

aclocal.m4

index 11c7acd..87b7e85 100644 (file)
@@ -1546,7 +1546,7 @@ if test "$RELEASE" = "NO"; then
 fi
 
     AC_MSG_CHECKING([for GHC Git commit id])
-    if test -d .git; then
+    if test -e .git; then
         git_commit_id=`git rev-parse HEAD`
         if test -n "$git_commit_id" 2>&1 >/dev/null; then true; else
             AC_MSG_ERROR([failed to detect revision: check that git is in your path])