From: Christian Couder Date: Sun, 1 Oct 2006 20:16:22 +0000 (+0200) Subject: Use git-update-ref to delete a tag instead of rm()ing the ref file. X-Git-Tag: v1.4.4-rc1~44^2~16 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=d3d0013c59ed840520b86a65697137cb2c62819c;p=git.git Use git-update-ref to delete a tag instead of rm()ing the ref file. Signed-off-by: Christian Couder Signed-off-by: Junio C Hamano --- diff --git a/git-tag.sh b/git-tag.sh index 2bde3c05f..6463b314c 100755 --- a/git-tag.sh +++ b/git-tag.sh @@ -47,8 +47,10 @@ do -d) shift tag_name="$1" - rm "$GIT_DIR/refs/tags/$tag_name" && \ - echo "Deleted tag $tag_name." + tag=$(git-show-ref --verify --hash -- "refs/tags/$tag_name") || + die "Seriously, what tag are you talking about?" + git-update-ref -m 'tag: delete' -d "refs/tags/$tag_name" "$tag" && + echo "Deleted tag $tag_name." exit $? ;; -*)