auto-version.in: Don't insist that `.git' is a directory.
authorMark Wooding <mdw@distorted.org.uk>
Sat, 22 Jul 2017 10:35:55 +0000 (11:35 +0100)
committerMark Wooding <mdw@distorted.org.uk>
Thu, 7 May 2020 19:33:33 +0000 (20:33 +0100)
Nowadays, `git worktree' can cause this to be a regular file instead,
and it's a shame if we can't spot it properly.

(cherry picked from commit e3bf207c8bde1191c3850debd27ac604305bff31)

auto-version.in

index c9b1e27..d229a29 100755 (executable)
@@ -71,7 +71,7 @@ fi
 ### Main program.
 
 ## If this is a Git checkout then Git should be able to identify the version.
-if [ -d .git ] && version=$(git describe --abbrev=4 2>/dev/null); then
+if [ -e .git ] && version=$(git describe --abbrev=4 2>/dev/null); then
 
   ## If the working tree is dirty, indicate with a `+'.
   case "$(git diff-index --name-only HEAD)" in