From efdbeff79d528c72d9b4df7c286b49b389f613b5 Mon Sep 17 00:00:00 2001 From: Mitchell E Berger Date: Fri, 19 Nov 2010 05:36:27 -0500 Subject: [PATCH] git-hooks/zephyr-post-receive: Portability improvements $() command substitution is a bashism, so use bash instead of sh in the shebang line. 'readlink -f' isn't available everywhere, and we're not actually worried about canonicalizing the path so much as avoiding an uninformative "." as the name of the repo. Just cd into the directory and look at pwd. Signed-off-by: Mitchell E Berger --- git-hooks/zephyr-post-receive | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/git-hooks/zephyr-post-receive b/git-hooks/zephyr-post-receive index 71e96bc..1a21496 100755 --- a/git-hooks/zephyr-post-receive +++ b/git-hooks/zephyr-post-receive @@ -1,4 +1,4 @@ -#!/bin/sh +#!/bin/bash # # This script is run after receive-pack has accepted a pack and the # repository has been updated. It is passed arguments in through stdin @@ -25,9 +25,9 @@ if [ -z "$zsig" ]; then if [ -z "$zsig" ] || \ [ "$zsig" = "Unnamed repository; edit this file to name it for gitweb." ] || \ [ "$zsig" = "Unnamed repository; edit this file 'description' to name the repository." ]; then - zsig=$(basename "$(readlink -f "$GIT_DIR")") + zsig=$(basename "$(cd "$GIT_DIR" && pwd)") if [ "$zsig" = ".git" ]; then - zsig=$(basename "$(readlink -f "$GIT_DIR/..")") + zsig=$(basename "$(cd "$GIT_DIR/.." && pwd)") fi fi fi -- 2.45.0