verify-tag: make it operable from a subdirectory.
[gitweb.git] / git-tag.sh
index 6130904a94ddeffb15b1b10ded8336c67112c12e..e71028695c935c6c757ac168f1c9a1670076b29d 100755 (executable)
@@ -1,10 +1,10 @@
 #!/bin/sh
 # Copyright (c) 2005 Linus Torvalds
 
-. git-sh-setup || die "Not a git archive"
+GIT_DIR=`git-rev-parse --git-dir` || exit $?
 
 usage () {
-    echo >&2 "Usage: git-tag [-a | -s | -u <key-id>] [-f] [-m <msg>] <tagname> [<head>]"
+    echo >&2 "Usage: git-tag [-a | -s | -u <key-id>] [-f | -d] [-m <msg>] <tagname> [<head>]"
     exit 1
 }
 
@@ -37,6 +37,13 @@ do
        shift
        username="$1"
        ;;
+    -d)
+       shift
+       tag_name="$1"
+       rm "$GIT_DIR/refs/tags/$tag_name" && \
+               echo "Deleted tag $tag_name."
+       exit $?
+       ;;
     -*)
         usage
        ;;