This is an automated email from the ASF dual-hosted git repository.

frankgh pushed a commit to branch cassandra-6.0
in repository https://gitbox.apache.org/repos/asf/cassandra.git


The following commit(s) were added to refs/heads/cassandra-6.0 by this push:
     new 92a0863358 Fix git hooks in cassandra builds where core.symlinks is 
false
92a0863358 is described below

commit 92a0863358bb5443b597e338e97c43eb9ddc2e54
Author: Francisco Guerrero <[email protected]>
AuthorDate: Thu Jun 4 10:11:21 2026 -0700

    Fix git hooks in cassandra builds where core.symlinks is false
    
    patch by Francisco Guerrero; reviewed by TBD for CASSANDRA-21430
---
 .build/git/install-git-defaults.sh | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)

diff --git a/.build/git/install-git-defaults.sh 
b/.build/git/install-git-defaults.sh
index 7c26ed5eda..55ced5d74b 100755
--- a/.build/git/install-git-defaults.sh
+++ b/.build/git/install-git-defaults.sh
@@ -63,8 +63,18 @@ install_hook() {
       installed=false
     fi
   fi
+  # Resolve the source hooks directory. When git is configured with
+  # core.symlinks=false (e.g. for security reasons, or on filesystems that
+  # don't support symlinks), a symlinked hooks dir such as post-switch is
+  # checked out as a plain text file whose contents are the link target.
+  # Follow that indirection so the build works regardless of core.symlinks.
+  local src_dir="$bin/git-hooks/${name}"
+  while [[ -f "$src_dir" ]]; do
+    src_dir="$(dirname "$src_dir")/$(cat "$src_dir")"
+  done
+
   # install all hooks
-  cp "$bin"/git-hooks/"${name}"/* "$d_dir"/
+  cp "$src_dir"/* "$d_dir"/
 
   # install coordinator hook
   install_template_script "$script_name" "$d_dir"


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to