X-Git-Url: https://snippets.scripts.mit.edu/gitweb.cgi/Scripts/git/.git/blobdiff_plain/a4574a077d024f32da50d26416efd5346f423479..83cedfd65c1c6b0dd70058dfed7c78424f7212f7:/git-hooks/zephyr-post-receive diff --git a/git-hooks/zephyr-post-receive b/git-hooks/zephyr-post-receive index 11e36c6..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 @@ -22,10 +22,12 @@ if [ -z "$zsig" ]; then if [ -e "$GIT_DIR/description" ]; then zsig=`cat "$GIT_DIR/description"` fi - if [ -z "$zsig" ] || [ "$zsig" = "Unnamed repository; edit this file to name it for gitweb." ]; then - zsig=$(basename "$(readlink -f "$GIT_DIR")") + 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 "$(cd "$GIT_DIR" && pwd)") if [ "$zsig" = ".git" ]; then - zsig=$(basename "$(readlink -f "$GIT_DIR/..")") + zsig=$(basename "$(cd "$GIT_DIR/.." && pwd)") fi fi fi