Commit 3b8ef1a831c223c2baf34c97f4d4e396bb86bd4a

Stefan Sperling 2018-09-14T00:25:13

tweak diff output and adjust test expectations accordingly

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++;
 	}