#!/bin/sh # refname="$1" oldrev="$2" newrev="$3" # Safety check if [ -z "$GIT_DIR" ]; then echo "Don't run this script from the command line." >&2 echo " (if you want, you could supply GIT_DIR then run" >&2 echo " $0 )" >&2 exit 1 fi if [ -z "$refname" -o -z "$oldrev" -o -z "$newrev" ]; then echo "usage: $0 " >&2 exit 1 fi # Check types # if $newrev is 0000...0000, it's a commit to delete a ref. zero=$(git hash-object --stdin