diff: Add test to capture regression in Git
In a recent update in Git b55e6d36eb (diff: ensure consistent diff behavior with ignore options, 2025-08-08), the diff output was modified to make it consistent across various ignore options. This commit however introduced a regression wherein the diff header would also barf out unnecessary details, for e.g:
$ git -c core.pager="" diff --raw --ignore-all-space 317fd88894fef1f07fb16b54f531779158706834 eeacdefef23b5be4e0b0275128fd71e3a4541a6d :100644 100644 1910281 ba0e162 M .gitmodules diff --git a/submodule b/submodule new file mode 160000 index 0000000..549090f :000000 160000 0000000 549090f A submodule
This was a regression in Git. Fortunately this has been fixed in Git and merged to master via 623f7af284 (diff: restore redirection to /dev/null for diff_from_contents, 2025-10-17) and 3da4413dbc (diff: make sure the other caller of diff_flush_patch_quietly() is silent, 2025-10-22).
Gitaly updates the Git version used to point to the latest master, between the regression and the fixes, the change to master tripped tests in the GitLab rails repository prompting a revert of the Git master version update. Add a test in Gitaly which would catch this regression. When the next version of Git master update occurs, if the test passes, we know that the Git version includes the required fixes and as such as we can safely merge in the update.
Closes git#614 (closed)