t6120: use git-update-ref rather than filesystem access

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

Han-Wen Nienhuys committed Aug 2, 2021 at 16:53 UTC e46775cf9e1c6ddca0ada3c1ca24876b79a23d9a
1 file changed +4 -2
t/t6120-describe.sh
+4 -2
@@ -107,7 +107,8 @@ test_expect_success 'describe --contains defaults to HEAD without commit-ish' '
107 check_describe tags/A --all A^0
108
109 test_expect_success 'renaming tag A to Q locally produces a warning' "
110 - mv .git/refs/tags/A .git/refs/tags/Q &&
110 + git update-ref refs/tags/Q $(git rev-parse refs/tags/A) &&
111 + git update-ref -d refs/tags/A &&
112 git describe HEAD 2>err >out &&
113 cat >expected <<-\EOF &&
114 warning: tag 'Q' is externally known as 'A'
@@ -135,7 +136,8 @@ test_expect_success 'abbrev=0 will not break misplaced tag (2)' '
136 '
137
138 test_expect_success 'rename tag Q back to A' '
138 - mv .git/refs/tags/Q .git/refs/tags/A
139 + git update-ref refs/tags/A $(git rev-parse refs/tags/Q) &&
140 + git update-ref -d refs/tags/Q
141 '
142
143 test_expect_success 'pack tag refs' 'git pack-refs'