Skip to content

Commit a0c88b2

Browse files
committed
Fix check of WeeChat Relay git repository
The `.git` directory can also be a regular file in a git worktree.
1 parent ba8bf89 commit a0c88b2

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

tools/build_debian.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ fi
134134

135135
# check git repository
136136
root_dir=$(git rev-parse --show-toplevel)
137-
if [ -z "${root_dir}" ] || [ ! -d "${root_dir}/.git" ] || [ ! -d "${root_dir}/debian-stable" ]; then
137+
if [ -z "${root_dir}" ] || [ ! -e "${root_dir}/.git" ] || [ ! -d "${root_dir}/debian-stable" ]; then
138138
error "this script must be run from WeeChat Relay git repository."
139139
fi
140140
cd "${root_dir}"

tools/makedist.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535

3636
# check git repository
3737
root_dir=$(git rev-parse --show-toplevel)
38-
if [ -z "${root_dir}" ] || [ ! -d "${root_dir}/.git" ]; then
38+
if [ -z "${root_dir}" ] || [ ! -e "${root_dir}/.git" ]; then
3939
echo "This script must be run from WeeChat Relay git repository."
4040
exit 1
4141
fi

tools/set_git_version.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ git_version=""
4343
case ${version} in
4444
*-*)
4545
# devel/rc version (like 1.0.0-dev or 1.0.0-rc1)
46-
if [ -d "${root_dir}/.git" ]; then
46+
if [ -e "${root_dir}/.git" ]; then
4747
git_version=$(cd "${root_dir}" && git describe 2>/dev/null)
4848
fi
4949
if [ -z "${git_version}" ]; then

0 commit comments

Comments
 (0)