From 8b001dca7b87a0cbb16529f4efd5c5d813bc1999 Mon Sep 17 00:00:00 2001 From: jdalton Date: Mon, 13 Apr 2026 21:36:31 -0400 Subject: [PATCH] fix(hooks): guard strings/cat against set -e abort in pre-push Add || echo "" fallback to strings and cat command substitutions. Without this, if strings is not installed (e.g. minimal Docker/CI images), set -e silently aborts the script with exit 127, blocking the push with no message. --- .git-hooks/pre-push | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.git-hooks/pre-push b/.git-hooks/pre-push index acc504f..1913411 100755 --- a/.git-hooks/pre-push +++ b/.git-hooks/pre-push @@ -128,9 +128,9 @@ while read local_ref local_sha remote_ref remote_sha; do fi if [ "$is_binary" = true ]; then - file_text=$(strings "$file" 2>/dev/null) + file_text=$(strings "$file" 2>/dev/null || echo "") else - file_text=$(cat "$file" 2>/dev/null) + file_text=$(cat "$file" 2>/dev/null || echo "") fi # Check for hardcoded user paths.