don't display blob IDs twice when diffing blobs directly
diff --git a/lib/diff.c b/lib/diff.c
index e750f2f..39132fa 100644
--- a/lib/diff.c
+++ b/lib/diff.c
@@ -101,8 +101,10 @@ diff_blobs(struct got_blob_object *blob1, struct got_blob_object *blob2,
args.diff_context = 3;
flags |= D_PROTOTYPE;
- fprintf(outfile, "blob - %s\n", idstr1);
- fprintf(outfile, "blob + %s\n", idstr2);
+ if (label1 && strcmp(label1, idstr1) != 0)
+ fprintf(outfile, "blob - %s\n", idstr1);
+ if (label2 && strcmp(label2, idstr2) != 0)
+ fprintf(outfile, "blob + %s\n", idstr2);
err = got_diffreg(&res, f1, f2, flags, &args, &ds, outfile, changes);
done:
diff --git a/regress/repository/repository_test.c b/regress/repository/repository_test.c
index 7d27483..9b48c7f 100644
--- a/regress/repository/repository_test.c
+++ b/regress/repository/repository_test.c
@@ -312,8 +312,6 @@ repo_diff_blob(const char *repo_path)
size_t len;
const char delim[3] = {'\0', '\0', '\0'};
const char *expected_output[] = {
- "blob - 141f5fdc96126c1f4195558560a3c915e3d9b4c3",
- "blob + de7eb21b21c7823a753261aadf7cba35c9580fbf",
"--- 141f5fdc96126c1f4195558560a3c915e3d9b4c3",
"+++ de7eb21b21c7823a753261aadf7cba35c9580fbf",
"@@ -1,10 +1,10 @@",