]> git.ipfire.org Git - thirdparty/git.git/commitdiff
lib-t6000.sh: write tag using git-update-ref
authorHan-Wen Nienhuys <hanwen@google.com>
Tue, 30 Jun 2020 12:05:35 +0000 (12:05 +0000)
committerJunio C Hamano <gitster@pobox.com>
Tue, 7 Jul 2020 04:38:32 +0000 (21:38 -0700)
Signed-off-by: Han-Wen Nienhuys <hanwen@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
t/lib-t6000.sh

index b0ed4767e320e200c592e979dce0fa1e4cfd6ede..fba6778ca35a2022513c8b36434fc24825e875c2 100644 (file)
@@ -1,7 +1,5 @@
 : included from 6002 and others
 
-mkdir -p .git/refs/tags
-
 >sed.script
 
 # Answer the sha1 has associated with the tag. The tag must exist under refs/tags
@@ -26,7 +24,8 @@ save_tag () {
        _tag=$1
        test -n "$_tag" || error "usage: save_tag tag commit-args ..."
        shift 1
-       "$@" >".git/refs/tags/$_tag"
+
+       git update-ref "refs/tags/$_tag" $("$@")
 
        echo "s/$(tag $_tag)/$_tag/g" >sed.script.tmp
        cat sed.script >>sed.script.tmp