Skip to content

Commit 9e35a6a

Browse files
hanwengitster
authored andcommitted
lib-t6000.sh: write tag using git-update-ref
Signed-off-by: Han-Wen Nienhuys <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent a08a83d commit 9e35a6a

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

t/lib-t6000.sh

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
: included from 6002 and others
22

3-
mkdir -p .git/refs/tags
4-
53
>sed.script
64

75
# Answer the sha1 has associated with the tag. The tag must exist under refs/tags
@@ -26,7 +24,8 @@ save_tag () {
2624
_tag=$1
2725
test -n "$_tag" || error "usage: save_tag tag commit-args ..."
2826
shift 1
29-
"$@" >".git/refs/tags/$_tag"
27+
28+
git update-ref "refs/tags/$_tag" $("$@")
3029

3130
echo "s/$(tag $_tag)/$_tag/g" >sed.script.tmp
3231
cat sed.script >>sed.script.tmp

0 commit comments

Comments
 (0)