Commit Diff


commit - c4d35c5bb4f936d0f96bb62d234001b68dc33089
commit + 7f959095d870780b8583469cb15673aba6164da2
blob - 9731ce78ee76e120a9a9747158089178ac3758e7
blob + c9a711f7c6066bf89187c9058634f85a5a61c2e1
--- lib/object_parse.c
+++ lib/object_parse.c
@@ -759,7 +759,7 @@ got_object_read_commit(struct got_commit_object **comm
 		return err;
 
 	SHA1Final(id.sha1, &sha1_ctx);
-	if (memcmp(expected_id->sha1, id.sha1, SHA1_DIGEST_LENGTH) != 0) {
+	if (got_object_id_cmp(expected_id, &id) != 0) {
 		char buf[SHA1_DIGEST_STRING_LENGTH];
 		err = got_error_fmt(GOT_ERR_OBJ_CSUM,
 		    "checksum failure for object %s",
@@ -932,7 +932,7 @@ got_object_read_tree(struct got_parsed_tree_entry **en
 		return err;
 
 	SHA1Final(id.sha1, &sha1_ctx);
-	if (memcmp(expected_id->sha1, id.sha1, SHA1_DIGEST_LENGTH) != 0) {
+	if (got_object_id_cmp(expected_id, &id) != 0) {
 		char buf[SHA1_DIGEST_STRING_LENGTH];
 		err = got_error_fmt(GOT_ERR_OBJ_CSUM,
 		    "checksum failure for object %s",
@@ -1176,7 +1176,7 @@ got_object_read_tag(struct got_tag_object **tag, int f
 		return err;
 
 	SHA1Final(id.sha1, &sha1_ctx);
-	if (memcmp(expected_id->sha1, id.sha1, SHA1_DIGEST_LENGTH) != 0) {
+	if (got_object_id_cmp(expected_id, &id) != 0) {
 		char buf[SHA1_DIGEST_STRING_LENGTH];
 		err = got_error_fmt(GOT_ERR_OBJ_CSUM,
 		    "checksum failure for object %s",