Git fork

help: print zlib-ng version number

When building against zlib-ng, the header file `zlib.h` is not included,
but `zlib-ng.h` is included instead. It's `zlib.h` that defines
`ZLIB_VERSION` and that macro is used to print out zlib version in
`git-version(1)` with `--build-options`. But when it's not defined, no
version is printed.

`zlib-ng.h` defines another macro: `ZLIBNG_VERSION`. Use that macro to
print the zlib-ng version in `git version --build-options` when it's
set. Otherwise fallback to `ZLIB_VERSION`.

Signed-off-by: Toon Claes <toon@iotcl.com>
Helped-by: Patrick Steinhardt <ps@pks.im>
Reviewed-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

authored by

Toon Claes and committed by
Junio C Hamano
2b1e0f8c 49d9cd8d

+5 -2
+3 -1
help.c
··· 776 776 #if defined OPENSSL_VERSION_TEXT 777 777 strbuf_addf(buf, "OpenSSL: %s\n", OPENSSL_VERSION_TEXT); 778 778 #endif 779 - #if defined ZLIB_VERSION 779 + #if defined ZLIBNG_VERSION 780 + strbuf_addf(buf, "zlib-ng: %s\n", ZLIBNG_VERSION); 781 + #elif defined ZLIB_VERSION 780 782 strbuf_addf(buf, "zlib: %s\n", ZLIB_VERSION); 781 783 #endif 782 784 }
+2 -1
t/t0091-bugreport.sh
··· 47 47 # This is bound to differ from environment to environment, 48 48 # so we just do some rather high-level checks. 49 49 grep "uname: ." system && 50 - grep "compiler info: ." system 50 + grep "compiler info: ." system && 51 + grep "zlib." system 51 52 ' 52 53 53 54 test_expect_success 'dies if file with same name as report already exists' '