]> git.eshelyaron.com Git - emacs.git/commitdiff
Run Git hooks within xcu4
authorPo Lu <luangruo@yahoo.com>
Wed, 9 Aug 2023 01:20:15 +0000 (09:20 +0800)
committerPo Lu <luangruo@yahoo.com>
Wed, 9 Aug 2023 01:48:32 +0000 (09:48 +0800)
* build-aux/git-hooks/pre-commit (LC_ALL):
* build-aux/git-hooks/prepare-commit-msg (SHA1): Run using xcu4
tools.

build-aux/git-hooks/pre-commit
build-aux/git-hooks/prepare-commit-msg

index f89d9ca8f8cc3aeab1b2d440e68fdf6449ff7ddc..12b08d2c25f95e52bc3ab485673d0b5f2b0535b0 100755 (executable)
 LC_ALL=C
 export LC_ALL
 
+# If this is a system where /bin/sh isn't sufficient to
+# run git-sh-setup, use a working shell as a recourse.
+if test -x "/usr/xpg4/bin/sh" && test -z "$POSIX_SHELL"; then
+    POSIX_SHELL=1
+    export POSIX_SHELL
+    exec "/usr/xpg4/bin/sh" `dirname $0`/pre-commit
+fi
+
 exec >&2
 
 . git-sh-setup
index 7802dffda43a00a77bfb24b7b0897b3e078592ff..1520ef3f5f8a761ca410ae0347383fb39dd8b80a 100755 (executable)
@@ -25,6 +25,10 @@ SHA1=$3
 # Prefer gawk if available, as it handles NUL bytes properly.
 if type gawk >/dev/null 2>&1; then
   awk="gawk"
+# Next use /usr/xpg4/bin/awk if available, since the script
+# doesn't support Unix awk.
+elif test -x /usr/xpg4/bin/awk; then
+  awk="/usr/xpg4/bin/awk"
 else
   awk="awk"
 fi