]> git.ipfire.org Git - thirdparty/git.git/commitdiff
t6120: use git-update-ref rather than filesystem access
authorHan-Wen Nienhuys <hanwen@google.com>
Mon, 2 Aug 2021 16:53:28 +0000 (16:53 +0000)
committerJunio C Hamano <gitster@pobox.com>
Mon, 2 Aug 2021 20:17:20 +0000 (13:17 -0700)
Signed-off-by: Han-Wen Nienhuys <hanwen@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
t/t6120-describe.sh

index 1a501ee09e1b43dd30a19e47434cc6b88d21a9b3..bae2419150b8b52244dda726a4d2eaf10c1405ce 100755 (executable)
@@ -107,7 +107,8 @@ test_expect_success 'describe --contains defaults to HEAD without commit-ish' '
 check_describe tags/A --all A^0
 
 test_expect_success 'renaming tag A to Q locally produces a warning' "
-       mv .git/refs/tags/A .git/refs/tags/Q &&
+       git update-ref refs/tags/Q $(git rev-parse refs/tags/A) &&
+       git update-ref -d refs/tags/A &&
        git describe HEAD 2>err >out &&
        cat >expected <<-\EOF &&
        warning: tag 'Q' is externally known as 'A'
@@ -135,7 +136,8 @@ test_expect_success 'abbrev=0 will not break misplaced tag (2)' '
 '
 
 test_expect_success 'rename tag Q back to A' '
-       mv .git/refs/tags/Q .git/refs/tags/A
+       git update-ref refs/tags/A $(git rev-parse refs/tags/Q) &&
+       git update-ref -d refs/tags/Q
 '
 
 test_expect_success 'pack tag refs' 'git pack-refs'