Commit Diff


commit - 2be33b091701ba8292b338d88696867872304963
commit + 1ba62ba45b6de8e8b3a55cc4a3b84c69ab7f0fdc
blob - bd60dd7a2516c5bf34898dbb798f04b990a38115
blob + cfb1f98b880d584709f8c09b1952ca89aed51bae
--- lib/object_parse.c
+++ lib/object_parse.c
@@ -758,7 +758,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",
@@ -931,7 +931,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",
@@ -1175,7 +1175,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",