diff options
author | Han-Wen Nienhuys <hanwen@google.com> | 2021-12-22 10:59:43 +0000 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2021-12-22 12:13:01 -0800 |
commit | be49349c72d455217f3d7fd2b7760ef51561ccf5 (patch) | |
tree | 829cc5a079ecb9bcda22b666bbad371fc413c870 | |
parent | t5550: require REFFILES (diff) | |
download | tgif-be49349c72d455217f3d7fd2b7760ef51561ccf5.tar.xz |
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 <hanwen@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
-rwxr-xr-x | t/t7004-tag.sh | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/t/t7004-tag.sh b/t/t7004-tag.sh index 082be85dff..301d119048 100755 --- a/t/t7004-tag.sh +++ b/t/t7004-tag.sh @@ -94,10 +94,10 @@ test_expect_success 'creating a tag with --create-reflog should create reflog' ' git log -1 \ --format="format:tag: tagging %h (%s, %cd)%n" \ --date=format:%Y-%m-%d >expected && - test_when_finished "git tag -d tag_with_reflog" && - git tag --create-reflog tag_with_reflog && - git reflog exists refs/tags/tag_with_reflog && - sed -e "s/^.* //" .git/logs/refs/tags/tag_with_reflog >actual && + test_when_finished "git tag -d tag_with_reflog1" && + git tag --create-reflog tag_with_reflog1 && + git reflog exists refs/tags/tag_with_reflog1 && + sed -e "s/^.* //" .git/logs/refs/tags/tag_with_reflog1 >actual && test_cmp expected actual ' @@ -105,10 +105,10 @@ test_expect_success 'annotated tag with --create-reflog has correct message' ' git log -1 \ --format="format:tag: tagging %h (%s, %cd)%n" \ --date=format:%Y-%m-%d >expected && - test_when_finished "git tag -d tag_with_reflog" && - git tag -m "annotated tag" --create-reflog tag_with_reflog && - git reflog exists refs/tags/tag_with_reflog && - sed -e "s/^.* //" .git/logs/refs/tags/tag_with_reflog >actual && + test_when_finished "git tag -d tag_with_reflog2" && + git tag -m "annotated tag" --create-reflog tag_with_reflog2 && + git reflog exists refs/tags/tag_with_reflog2 && + sed -e "s/^.* //" .git/logs/refs/tags/tag_with_reflog2 >actual && test_cmp expected actual ' @@ -118,10 +118,10 @@ test_expect_success '--create-reflog does not create reflog on failure' ' ' test_expect_success 'option core.logAllRefUpdates=always creates reflog' ' - test_when_finished "git tag -d tag_with_reflog" && + test_when_finished "git tag -d tag_with_reflog3" && test_config core.logAllRefUpdates always && - git tag tag_with_reflog && - git reflog exists refs/tags/tag_with_reflog + git tag tag_with_reflog3 && + git reflog exists refs/tags/tag_with_reflog3 ' test_expect_success 'listing all tags if one exists should succeed' ' |