Commit Diff


commit - c0cbb5f423a2a6324675956dc85b4090cf70a34c
commit + 1eb651da6aa7d016f6c30a0417b4259f5de7a35c
blob - f448440ff5880b5d6ec7ec9b7d45ef85b47ee2e6
blob + 245df76cba6ccd1d6c155ecbb3632f386db7f3e1
--- lib/diff.c
+++ lib/diff.c
@@ -378,8 +378,15 @@ diff_blob_file(struct got_diffreg_result **resultp,
 
 	err = got_diffreg(&result, f1, f2, diff_algo, ignore_whitespace,
 	    force_text_diff);
-	if (err)
+	if (err) {
+		char msg[GOT_ERR_MAX_MSG_SIZE];
+		if (snprintf(msg, sizeof(msg), "%s vs %s: %s",
+		             label1 ? label1 : idstr1,
+		             f2_exists ? label2 : "/dev/null", err->msg) >= 0) {
+			err = got_error_msg(err->code, msg);
+		}
 		goto done;
+	}
 
 	if (outfile) {
 		err = got_diffreg_output(NULL, NULL, result,