summaryrefslogtreecommitdiff
path: root/findversion.sh
diff options
context:
space:
mode:
authorGeorge Koehler <kernigh@gmail.com>2019-08-28 17:45:36 -0400
committerCharles Pigott <charlespigott@googlemail.com>2019-08-31 20:11:24 +0100
commitc655f89d845a4d670c7b30575c5b8de799b12363 (patch)
tree38e5a29d82e3368394b4e3bf78aeadea7171778d /findversion.sh
parent14bca191631f557b555d027f352824e6ee2a54f8 (diff)
downloadopenttd-c655f89d845a4d670c7b30575c5b8de799b12363.tar.xz
Fix: Allow git worktree in version detection; drop svn, hg.
If $ROOT_DIR is a linked working tree from git-worktree(1), then $ROOT_DIR/.git is a regular file instead of a directory. Allow this when deciding whether to use git to detect OpenTTD's version. Drop checks for svn and hg in config.lib, because findversion.sh hasn't used svn nor hg since 192770e6da.
Diffstat (limited to 'findversion.sh')
-rwxr-xr-xfindversion.sh2
1 files changed, 1 insertions, 1 deletions
diff --git a/findversion.sh b/findversion.sh
index 95a041bac..0da382476 100755
--- a/findversion.sh
+++ b/findversion.sh
@@ -59,7 +59,7 @@ ROOT_DIR=`pwd`
# Determine if we are using a modified version
# Assume the dir is not modified
MODIFIED="0"
-if [ -d "$ROOT_DIR/.git" ]; then
+if [ -d "$ROOT_DIR/.git" ] || [ -f "$ROOT_DIR/.git" ]; then
# We are a git checkout
# Refresh the index to make sure file stat info is in sync, then look for modifications
git update-index --refresh >/dev/null