summaryrefslogtreecommitdiff
path: root/t/t6120-describe.sh
diff options
context:
space:
mode:
authorLibravatar Junio C Hamano <gitster@pobox.com>2021-08-24 15:32:39 -0700
committerLibravatar Junio C Hamano <gitster@pobox.com>2021-08-24 15:32:39 -0700
commit276bc6357ebe50dae070aff9693a21c4a2bafc28 (patch)
treec49d20b358176aa2b94ebb3ccb89d35ac542d522 /t/t6120-describe.sh
parentMerge branch 'en/ort-perf-batch-15' (diff)
parentt6001: avoid direct file system access (diff)
downloadtgif-276bc6357ebe50dae070aff9693a21c4a2bafc28.tar.xz
Merge branch 'hn/refs-test-cleanup'
A handful of tests that assumed implementation details of files backend for refs have been cleaned up. * hn/refs-test-cleanup: t6001: avoid direct file system access t6500: use "ls -1" to snapshot ref database state t7064: use update-ref -d to remove upstream branch t1410: mark test as REFFILES t1405: mark test for 'git pack-refs' as REFFILES t1405: use 'git reflog exists' to check reflog existence t2402: use ref-store test helper to create broken symlink t3320: use git-symbolic-ref rather than filesystem access t6120: use git-update-ref rather than filesystem access t1503: mark symlink test as REFFILES t6050: use git-update-ref rather than filesystem access
Diffstat (limited to 't/t6120-describe.sh')
-rwxr-xr-xt/t6120-describe.sh6
1 files changed, 4 insertions, 2 deletions
diff --git a/t/t6120-describe.sh b/t/t6120-describe.sh
index 1a501ee09e..bae2419150 100755
--- a/t/t6120-describe.sh
+++ b/t/t6120-describe.sh
@@ -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'