tweak diff output and adjust test expectations accordingly
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42
diff --git a/lib/diff.c b/lib/diff.c
index 1d149da..e750f2f 100644
--- a/lib/diff.c
+++ b/lib/diff.c
@@ -101,8 +101,8 @@ 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);
+ fprintf(outfile, "blob - %s\n", idstr1);
+ 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 42f3d85..7d27483 100644
--- a/regress/repository/repository_test.c
+++ b/regress/repository/repository_test.c
@@ -312,10 +312,10 @@ 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 +++",
- "--- regress/repository_test/Makefile",
- "+++ regress/repository_test/Makefile",
+ "blob - 141f5fdc96126c1f4195558560a3c915e3d9b4c3",
+ "blob + de7eb21b21c7823a753261aadf7cba35c9580fbf",
+ "--- 141f5fdc96126c1f4195558560a3c915e3d9b4c3",
+ "+++ de7eb21b21c7823a753261aadf7cba35c9580fbf",
"@@ -1,10 +1,10 @@",
" .PATH:${.CURDIR}/../../lib",
" ",
@@ -367,6 +367,7 @@ repo_diff_blob(const char *repo_path)
strcmp(line, expected_output[i]) != 0) {
test_printf("diff output mismatch; expected: '%s'\n",
expected_output[i]);
+ return 0;
}
i++;
}