diff --git a/diff.c b/diff.c
index c8e43664fb8c01ecba9cf74b3f9cbf5e8c1cbaea..0ecbf325a264f3829922017e46451009a332d0ef 100644
--- a/diff.c
+++ b/diff.c
@@ -1972,7 +1972,7 @@ static void builtin_diff(const char *name_a,
 		struct emit_callback ecbdata;
 		const struct userdiff_funcname *pe;
 
-		if (!DIFF_XDL_TST(o, WHITESPACE_FLAGS) || must_show_header) {
+		if (must_show_header) {
 			fprintf(o->file, "%s", header.buf);
 			strbuf_reset(&header);
 		}
diff --git a/t/t4011-diff-symlink.sh b/t/t4011-diff-symlink.sh
index 164f1538557d2026c46ccf6b40381ab7ba0c501a..f0d5041c11581ec2d711c0ea3bfd479019814b78 100755
--- a/t/t4011-diff-symlink.sh
+++ b/t/t4011-diff-symlink.sh
@@ -67,10 +67,7 @@ test_expect_success SYMLINKS 'diff removed symlink and file' '
 '
 
 test_expect_success SYMLINKS 'diff identical, but newly created symlink and file' '
-	cat >expected <<-\EOF &&
-	diff --git a/frotz b/frotz
-	diff --git a/nitfol b/nitfol
-	EOF
+	>expected &&
 	rm -f frotz nitfol &&
 	echo xyzzy >nitfol &&
 	test-chmtime +10 nitfol &&