diff options
| author | Yuri Olive <yuriso1994@gmail.com> | 2026-10-31 17:55:09 -0300 |
|---|---|---|
| committer | kraibse <33869366+kraibse@users.noreply.github.com> | 2026-11-01 02:20:53 +0100 |
| commit | 37908985af9d080bc4795c16c8e49c7ef1d2a98b (patch) | |
| tree | 87eeeb3af0e332ca4811d369f435b43b98cf95db /CMakeLists.txt | |
| parent | feff94e8bb60bae13995b30dcb3abe717cfaaff3 (diff) | |
cmake: skip the pre-commit hook copy when .git is not a directory
In a git worktree .git is a file, so copying hooks/pre-commit into
.git/hooks failed and stopped configuring. Check IS_DIRECTORY instead
of EXISTS.
Assisted-by: Claude Sonnet 5.5 (code drafting and testing)
Diffstat (limited to 'CMakeLists.txt')
| -rw-r--r-- | CMakeLists.txt | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index fb2b96ed05..447490b456 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -293,7 +293,7 @@ if (ANDROID AND YUZU_DOWNLOAD_ANDROID_VVL) endif() if(EXISTS ${PROJECT_SOURCE_DIR}/hooks/pre-commit AND NOT EXISTS ${PROJECT_SOURCE_DIR}/.git/hooks/pre-commit) - if (EXISTS ${PROJECT_SOURCE_DIR}/.git/) + if (IS_DIRECTORY ${PROJECT_SOURCE_DIR}/.git) message(STATUS "Copying pre-commit hook") file(COPY hooks/pre-commit DESTINATION ${PROJECT_SOURCE_DIR}/.git/hooks) endif() |
