git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] Use git-update-ref to delete a tag instead of rm()ing the ref file.
@ 2006-10-01 20:16 Christian Couder
  0 siblings, 0 replies; only message in thread
From: Christian Couder @ 2006-10-01 20:16 UTC (permalink / raw)
  To: Junio Hamano; +Cc: git

Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
---
 git-tag.sh |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/git-tag.sh b/git-tag.sh
index 2bde3c0..6463b31 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 $?
 	;;
     -*)
-- 
1.4.2.1.g8a7b-dirty

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2006-10-01 20:10 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-10-01 20:16 [PATCH] Use git-update-ref to delete a tag instead of rm()ing the ref file Christian Couder

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).