Skip to content

Commit be49349

Browse files
hanwengitster
authored andcommitted
t7004: create separate tags for different tests
Reftable intentionally keeps reflog data for deleted refs. This breaks tests that delete and recreate "refs/tags/tag_with_reflog" as traces of the deletion are left in reflog. To resolve this, use a differently named ref for each test case. Signed-off-by: Han-Wen Nienhuys <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 7b6853a commit be49349

File tree

1 file changed

+11
-11
lines changed

1 file changed

+11
-11
lines changed

t/t7004-tag.sh

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -94,21 +94,21 @@ test_expect_success 'creating a tag with --create-reflog should create reflog' '
9494
git log -1 \
9595
--format="format:tag: tagging %h (%s, %cd)%n" \
9696
--date=format:%Y-%m-%d >expected &&
97-
test_when_finished "git tag -d tag_with_reflog" &&
98-
git tag --create-reflog tag_with_reflog &&
99-
git reflog exists refs/tags/tag_with_reflog &&
100-
sed -e "s/^.* //" .git/logs/refs/tags/tag_with_reflog >actual &&
97+
test_when_finished "git tag -d tag_with_reflog1" &&
98+
git tag --create-reflog tag_with_reflog1 &&
99+
git reflog exists refs/tags/tag_with_reflog1 &&
100+
sed -e "s/^.* //" .git/logs/refs/tags/tag_with_reflog1 >actual &&
101101
test_cmp expected actual
102102
'
103103

104104
test_expect_success 'annotated tag with --create-reflog has correct message' '
105105
git log -1 \
106106
--format="format:tag: tagging %h (%s, %cd)%n" \
107107
--date=format:%Y-%m-%d >expected &&
108-
test_when_finished "git tag -d tag_with_reflog" &&
109-
git tag -m "annotated tag" --create-reflog tag_with_reflog &&
110-
git reflog exists refs/tags/tag_with_reflog &&
111-
sed -e "s/^.* //" .git/logs/refs/tags/tag_with_reflog >actual &&
108+
test_when_finished "git tag -d tag_with_reflog2" &&
109+
git tag -m "annotated tag" --create-reflog tag_with_reflog2 &&
110+
git reflog exists refs/tags/tag_with_reflog2 &&
111+
sed -e "s/^.* //" .git/logs/refs/tags/tag_with_reflog2 >actual &&
112112
test_cmp expected actual
113113
'
114114

@@ -118,10 +118,10 @@ test_expect_success '--create-reflog does not create reflog on failure' '
118118
'
119119

120120
test_expect_success 'option core.logAllRefUpdates=always creates reflog' '
121-
test_when_finished "git tag -d tag_with_reflog" &&
121+
test_when_finished "git tag -d tag_with_reflog3" &&
122122
test_config core.logAllRefUpdates always &&
123-
git tag tag_with_reflog &&
124-
git reflog exists refs/tags/tag_with_reflog
123+
git tag tag_with_reflog3 &&
124+
git reflog exists refs/tags/tag_with_reflog3
125125
'
126126

127127
test_expect_success 'listing all tags if one exists should succeed' '

0 commit comments

Comments
 (0)