]> snippets.scripts.mit.edu Git - Scripts/git/.git/blobdiff - git-hooks/zephyr-post-receive
Barnowl-RT readable source
[Scripts/git/.git] / git-hooks / zephyr-post-receive
index 11e36c6af10fdf9dab898a71d2d5d4625da6e967..1a214968b5455a3bf242f26ca411287791153cc0 100755 (executable)
@@ -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