Commit 730a8aa0c1088c8ba0135932f9d1015bdf217f9c

Stefan Sperling 2018-04-24T13:49:33

don't override error codes in diff_modified_blob()

diff --git a/lib/diff.c b/lib/diff.c
index 884fe20..2edc9fd 100644
--- a/lib/diff.c
+++ b/lib/diff.c
@@ -185,17 +185,15 @@ diff_modified_blob(struct got_object_id *id1, struct got_object_id *id2,
 
 	err = got_object_open(&obj1, repo, id1);
 	if (err)
-		return got_error(GOT_ERR_BAD_OBJ_HDR);
+		return err;
 	if (got_object_get_type(obj1) != GOT_OBJ_TYPE_BLOB) {
 		err = got_error(GOT_ERR_OBJ_TYPE);
 		goto done;
 	}
 
 	err = got_object_open(&obj2, repo, id2);
-	if (err) {
-		err= got_error(GOT_ERR_BAD_OBJ_HDR);
+	if (err)
 		goto done;
-	}
 	if (got_object_get_type(obj2) != GOT_OBJ_TYPE_BLOB) {
 		err = got_error(GOT_ERR_BAD_OBJ_DATA);
 		goto done;