@matheusbsbs / matheus-bagliano / commits / d3d0013c59
Fork 0

Use git-update-ref to delete a tag instead of rm()ing the ref file.

Signed-off-by: Christian Couder <chriscool@tuxfamily.org> Signed-off-by: Junio C Hamano <junkio@cox.net>

Christian Couder committed Oct 1, 2006 at 22:16 UTC d3d0013c59ed840520b86a65697137cb2c62819c
1 file changed +4 -2
git-tag.sh
+4 -2
@@ -47,8 +47,10 @@ do
47 -d)
48 shift
49 tag_name="$1"
50 - rm "$GIT_DIR/refs/tags/$tag_name" && \
51 - echo "Deleted tag $tag_name."
50 + tag=$(git-show-ref --verify --hash -- "refs/tags/$tag_name") ||
51 + die "Seriously, what tag are you talking about?"
52 + git-update-ref -m 'tag: delete' -d "refs/tags/$tag_name" "$tag" &&
53 + echo "Deleted tag $tag_name."
54 exit $?
55 ;;
56 -*)