testsuite: Add --strip-trailing-cr to diff call
On Windows, git defaults to maintaining line endings, which means it changed \n to \r\n on all files it identifies as text. And that includes our test output. Luckily diff(1) has an option to undo that. And since we do not care about line endings in those tests, we can just use it.
This commit is contained in:
@@ -75,7 +75,7 @@ diff_with_file (const char *file1,
|
||||
process = g_subprocess_new (G_SUBPROCESS_FLAGS_STDIN_PIPE
|
||||
| G_SUBPROCESS_FLAGS_STDOUT_PIPE,
|
||||
error,
|
||||
"diff", "-u", file1, "-", NULL);
|
||||
"diff", "--strip-trailing-cr", "-u", file1, "-", NULL);
|
||||
if (process == NULL)
|
||||
return NULL;
|
||||
|
||||
|
@@ -42,7 +42,7 @@ diff_with_file (const char *file1,
|
||||
diff_cmd = g_find_program_in_path ("diff");
|
||||
if (diff_cmd)
|
||||
{
|
||||
const char *command[] = { diff_cmd, "-u", file1, NULL, NULL };
|
||||
const char *command[] = { diff_cmd, "--strip-trailing-cr", "-u", file1, NULL, NULL };
|
||||
|
||||
if (len < 0)
|
||||
len = strlen (text);
|
||||
|
Reference in New Issue
Block a user