diff mbox series

[26/26] t7004: avoid direct filesystem access

Message ID 4a5891fa8cc9514535d70b52a4fce2b21991bfef.1626800687.git.gitgitgadget@gmail.com (mailing list archive)
State Superseded
Headers show
Series [01/26] hash.h: provide constants for the hash IDs | expand

Commit Message

Han-Wen Nienhuys July 20, 2021, 5:04 p.m. UTC
From: Han-Wen Nienhuys <hanwen@google.com>

Signed-off-by: Han-Wen Nienhuys <hanwen@google.com>
---
 t/t7004-tag.sh | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)
diff mbox series

Patch

diff --git a/t/t7004-tag.sh b/t/t7004-tag.sh
index 2f72c5c6883..8bd84b0e404 100755
--- a/t/t7004-tag.sh
+++ b/t/t7004-tag.sh
@@ -97,7 +97,8 @@  test_expect_success 'creating a tag with --create-reflog should create reflog' '
 	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 &&
+	git reflog --format="format:tag: tagging %h (%s, %cd)%n" \
+		--date=format:%Y-%m-%d refs/tags/tag_with_reflog >actual &&
 	test_cmp expected actual
 '
 
@@ -108,7 +109,9 @@  test_expect_success 'annotated tag with --create-reflog has correct message' '
 	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 &&
+	git reflog \
+		--format="format:tag: tagging %h (%s, %cd)%n" \
+		--date=format:%Y-%m-%d >actual &&
 	test_cmp expected actual
 '