Commit Diff


commit - 268f7291e63638be363b7bccd95f97a73298d039
commit + 09de383e6e63acb41f89665120f8f9746b637605
blob - c7992b73cb317bc2e0ad0c8d713d036c6276e2db
blob + c89351f48f0b6b7aad4de60bfc866f18b5f6fd63
--- lib/diff.c
+++ lib/diff.c
@@ -104,8 +104,10 @@ diff_blobs(struct got_blob_object *blob1, struct got_b
 	args.diff_context = diff_context;
 	flags |= D_PROTOTYPE;
 
-	fprintf(outfile, "blob - %s\n", idstr1);
-	fprintf(outfile, "blob + %s\n", idstr2);
+	if (outfile) {
+		fprintf(outfile, "blob - %s\n", idstr1);
+		fprintf(outfile, "blob + %s\n", idstr2);
+	}
 	err = got_diffreg(&res, f1, f2, flags, &args, &ds, outfile, changes);
 done:
 	if (f1)