1
0
Fork 0
mirror of https://github.com/git/git.git synced 2024-10-28 12:59:41 +01:00

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>
This commit is contained in:
Han-Wen Nienhuys 2020-06-30 12:05:35 +00:00 committed by Junio C Hamano
parent a08a83db2b
commit 9e35a6a986

View 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