From 1191568c961f213a462fb1c85f2c6ba437feb2a9 Mon Sep 17 00:00:00 2001 From: Johannes Schindelin Date: Tue, 10 May 2022 00:29:55 +0200 Subject: [PATCH] scalar diagnose: accommodate Scalar's Functional Tests Those tests specifically verify that the `.zip` file path is shown on `stdout`. Let's do that again, under the assumption that there are scripts out there that rely on this behavior. Signed-off-by: Johannes Schindelin --- diagnose.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/diagnose.c b/diagnose.c index 659792473b4239..e770189b14ece3 100644 --- a/diagnose.c +++ b/diagnose.c @@ -327,10 +327,13 @@ int create_diagnostics_archive(struct strbuf *zip_path, enum diagnose_mode mode) goto diagnose_cleanup; } - fprintf(stderr, "\n" - "Diagnostics complete.\n" - "All of the gathered info is captured in '%s'\n", - zip_path->buf); + strbuf_reset(&buf); + strbuf_addf(&buf, "\n" + "Diagnostics complete.\n" + "All of the gathered info is captured in '%s'\n", + zip_path->buf); + write_or_die(stdout_fd, buf.buf, buf.len); + write_or_die(2, buf.buf, buf.len); diagnose_cleanup: if (archiver_fd >= 0) {