@matheusbsbs / matheus-bagliano / commits / 9e35a6a986
Fork 0

lib-t6000.sh: write tag using git-update-ref

Signed-off-by: Han-Wen Nienhuys <hanwen@google.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Han-Wen Nienhuys committed Jun 30, 2020 at 12:05 UTC 9e35a6a9865c3c9bc5b8908dcdd3a9a818612a6a
1 file changed +2 -3
t/lib-t6000.sh
+2 -3
@@ -1,7 +1,5 @@
1 : included from 6002 and others
2
3 -mkdir -p .git/refs/tags
4 -
3 >sed.script
4
5 # Answer the sha1 has associated with the tag. The tag must exist under refs/tags
@@ -26,7 +24,8 @@ save_tag () {
24 _tag=$1
25 test -n "$_tag" || error "usage: save_tag tag commit-args ..."
26 shift 1
29 - "$@" >".git/refs/tags/$_tag"
27 +
28 + git update-ref "refs/tags/$_tag" $("$@")
29
30 echo "s/$(tag $_tag)/$_tag/g" >sed.script.tmp
31 cat sed.script >>sed.script.tmp