]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
configure: .git can be a file as well
authorJason Ish <jason.ish@oisf.net>
Fri, 5 Apr 2024 16:33:14 +0000 (10:33 -0600)
committerVictor Julien <victor@inliniac.net>
Tue, 9 Apr 2024 17:29:32 +0000 (19:29 +0200)
In worktree scenarios, .git is a file. Assuming its a directory causes
the release date to check the ChangeLog instead of the last commit,
while not a big issue, can be confusing.

configure.ac

index 6e1e4c0e827d67c18c32a566b1c3128191fbc28d..14d1ae11445c588e26710f10b7ac2e76eef91b40 100644 (file)
@@ -2483,7 +2483,7 @@ return 0;
 # get git revision and last commit date
     AC_PATH_PROG(HAVE_GIT_CMD, git, "no")
     if test "$HAVE_GIT_CMD" != "no"; then
-        if [ test -d .git ]; then
+        if [ test -e .git ]; then
             REVISION=`git rev-parse --short HEAD`
             LAST_COMMIT_DATE=`git log -1 --date=short --pretty=format:%cd`
             REVISION="$REVISION $LAST_COMMIT_DATE"