Skip to content

Commit bd8f5bf

Browse files
committed
Use git hook path
1 parent a6b423b commit bd8f5bf

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

scripts/build.sh

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -155,14 +155,13 @@ setup_ccache() {
155155

156156
# Check if pre-commit hook is installed and install if missing
157157
install_precommit_if_git() {
158-
if git_dir=$(git rev-parse --git-dir 2>/dev/null); then
159-
:
160-
else
158+
if ! git_hook_path="$(git rev-parse --git-path hooks/pre-commit 2>/dev/null)"; then
161159
log debug "Not in a git repository, skipping pre-commit check"
162160
return 1
163161
fi
162+
log debug "Checking for pre-commit hooks at '${git_hook_path}'"
164163

165-
if [ ! -f "${git_dir}/hooks/pre-commit" ]; then
164+
if [ ! -f "${git_hook_path}" ]; then
166165
log info "Pre-commit hook not found, installing commit hooks"
167166
./scripts/dev/install-commit-hooks.sh
168167
fi

scripts/env/excl.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ if ! command -v celerlog >/dev/null 2>&1; then
1414
}
1515
fi
1616
if test -z "${SYSTEM_NAME}"; then
17+
celerlog debug "Set SYSTEM_NAME=${SYSTEM_NAME}"
1718
SYSTEM_NAME=$(uname -s)
1819
fi
1920

0 commit comments

Comments
 (0)