Skip to content

Commit

Permalink
Fix check of WeeChat Relay git repository
Browse files Browse the repository at this point in the history
The `.git` directory can also be a regular file in a git worktree.
  • Loading branch information
flashcode committed Oct 30, 2024
1 parent ba8bf89 commit a0c88b2
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion tools/build_debian.sh
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ fi

# check git repository
root_dir=$(git rev-parse --show-toplevel)
if [ -z "${root_dir}" ] || [ ! -d "${root_dir}/.git" ] || [ ! -d "${root_dir}/debian-stable" ]; then
if [ -z "${root_dir}" ] || [ ! -e "${root_dir}/.git" ] || [ ! -d "${root_dir}/debian-stable" ]; then
error "this script must be run from WeeChat Relay git repository."
fi
cd "${root_dir}"
Expand Down
2 changes: 1 addition & 1 deletion tools/makedist.sh
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@

# check git repository
root_dir=$(git rev-parse --show-toplevel)
if [ -z "${root_dir}" ] || [ ! -d "${root_dir}/.git" ]; then
if [ -z "${root_dir}" ] || [ ! -e "${root_dir}/.git" ]; then
echo "This script must be run from WeeChat Relay git repository."
exit 1
fi
Expand Down
2 changes: 1 addition & 1 deletion tools/set_git_version.sh
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ git_version=""
case ${version} in
*-*)
# devel/rc version (like 1.0.0-dev or 1.0.0-rc1)
if [ -d "${root_dir}/.git" ]; then
if [ -e "${root_dir}/.git" ]; then
git_version=$(cd "${root_dir}" && git describe 2>/dev/null)
fi
if [ -z "${git_version}" ]; then
Expand Down

0 comments on commit a0c88b2

Please sign in to comment.