Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Couder <chriscool@tuxfamily.org>2006-10-02 00:16:22 +0400
committerJunio C Hamano <junkio@cox.net>2006-10-02 02:17:43 +0400
commitd3d0013c59ed840520b86a65697137cb2c62819c (patch)
tree896826554f94ff139d022d1164f859b84abf0b38 /git-tag.sh
parent26a063a10bca57f65d8fed6c4550a70d44a70b81 (diff)
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>
Diffstat (limited to 'git-tag.sh')
-rwxr-xr-xgit-tag.sh6
1 files changed, 4 insertions, 2 deletions
diff --git a/git-tag.sh b/git-tag.sh
index 2bde3c05fc..6463b314c6 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 $?
;;
-*)