Thread (1 message) 1 message, 1 author, 2020-12-23

Re: [PATCH v4 10/20] mktag tests: test "hash-object" compatibility

From: Junio C Hamano <hidden>
Date: 2020-12-23 02:30:15

Ævar Arnfjörð Bjarmason  [off-list ref] writes:
quoted hunk
Change all the successful "mktag" tests to test that "hash-object"
produces the same hash for the input, and that fsck passes for
both.

This tests e.g. that "mktag" doesn't trim its input or otherwise munge
it in a way that "hash-object" doesn't.

Signed-off-by: Ævar Arnfjörð Bjarmason <redacted>
---
 t/t3800-mktag.sh | 26 +++++++++++++++-----------
 1 file changed, 15 insertions(+), 11 deletions(-)
diff --git a/t/t3800-mktag.sh b/t/t3800-mktag.sh
index f339321be8..c6826762d9 100755
--- a/t/t3800-mktag.sh
+++ b/t/t3800-mktag.sh
@@ -19,6 +19,16 @@ check_verify_failure () {
 	'
 }
 
+test_expect_mktag_success() {
+	test_expect_success "$1" '
+		git hash-object -t tag -w --stdin <tag.sig >expected &&
+		git fsck --strict &&
+		git mktag <tag.sig >hash &&
+		git fsck --strict &&
+		test_cmp expected hash
+	'
+}
;-)  Nice.

I'll stop here for tonight.  Thanks for working on this.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help