From d68785eb2b4405594813d2c7b7cf37f5d2fbe805 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Ekl=C3=B6f?= Date: Fri, 6 Mar 2020 22:16:33 +0100 Subject: [PATCH] generate-version: check for .git directory in *src* dir Instead of trying to run `git --rev-parse --is-inside-work-tree`, check if there's a .git directory under the source directory. This should fix an issue where we incorrectly decided we where in a foot git clone when we're just a subdirectory under another repository. --- generate-version.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/generate-version.sh b/generate-version.sh index a21d7ac..d17cd40 100755 --- a/generate-version.sh +++ b/generate-version.sh @@ -10,7 +10,7 @@ out_file=${3} # echo "source directory: ${src_dir}" # echo "output file: ${out_file}" -if command -v git > /dev/null && git rev-parse --is-inside-work-tree > /dev/null 2>&1; then +if [ -d "${src_dir}/.git" ] && command -v git > /dev/null; then workdir=$(pwd) cd "${src_dir}" git_version=$(git describe --always --tags)