Skip to content
Permalink
Browse files

fixup! tests: replace mingw_test_cmp with a helper in C

  • Loading branch information...
dscho committed Jun 22, 2018
1 parent 63f4efb commit cd1a74fc9dc8a07626c216940db9a51f25206e03
Showing with 8 additions and 2 deletions.
  1. +8 −2 t/helper/test-cmp.c
@@ -11,7 +11,10 @@ static int run_diff(const char *path1, const char *path2)
"diff", "--no-index", NULL, NULL, NULL
};
const char *env[] = {
"GIT_PAGER=cat", NULL
"GIT_PAGER=cat",
"GIT_DIR=/dev/null",
"HOME=/dev/null",
NULL
};

argv[2] = path1;
@@ -48,7 +51,10 @@ int cmd__cmp(int argc, const char **argv)
if (r1 == EOF)
return 0;
cmp_failed:
return !!run_diff(argv[1], argv[2]);
if (!run_diff(argv[1], argv[2]))
die("Huh? 'diff --no-index %s %s' succeeded",
argv[1], argv[2]);
return 1;
}
if (r1 == EOF || strbuf_cmp(&b0, &b1)) {
fclose(f0);

2 comments on commit cd1a74f

@hechaozong

This comment has been minimized.

Copy link

replied Jun 30, 2018

good

@dscho

This comment has been minimized.

Copy link
Member Author

replied Jul 1, 2018

@hechaozong Care to explain yourself?

Please sign in to comment.
You can’t perform that action at this time.