diff --git a/Documentation/RelNotes/2.51.0.adoc b/Documentation/RelNotes/2.51.0.adoc index f8adc2c5cf3b61..a73ea3e8086ce4 100644 --- a/Documentation/RelNotes/2.51.0.adoc +++ b/Documentation/RelNotes/2.51.0.adoc @@ -97,8 +97,8 @@ Performance, Internal Implementation, Development Support etc. * "git push" and "git fetch" are taught to update refs in batches to gain performance. - * Some code paths in the "git prune" used to ignore passed in - repository object and used the_repository singleton instance + * Some code paths in "git prune" used to ignore the passed-in + repository object and used the `the_repository` singleton instance instead, which has been corrected. * Update ".clang-format" and ".editorconfig" to match our style guide @@ -139,7 +139,7 @@ Performance, Internal Implementation, Development Support etc. * Redefine where the multi-pack-index sits in the object subsystem, which recently was restructured to allow multiple backends that support a single object source that belongs to one repository. A - midx does span mulitple "object sources". + MIDX does span multiple "object sources". * Reduce implicit assumption and dependence on the_repository in the object-file subsystem. @@ -292,11 +292,15 @@ including security updates, are included in this release. and also they learn to honor the -U command-line option. (merge 2b3ae04011 lm/add-p-context later to maint). - * The case where a new submodule takes a path where used to be a - completely different subproject is now dealt a bit better than + * The case where a new submodule takes a path where there used to be a + completely different subproject is now dealt with a bit better than before. (merge 5ed8c5b465 kj/renamed-submodule later to maint). + * The deflate codepath in "git archive --format=zip" had a + longstanding bug coming from misuse of zlib API, which has been + corrected. + * Other code cleanup, docfix, build fix, etc. (merge b257adb571 lo/my-first-ow-doc-update later to maint). (merge 8b34b6a220 ly/sequencer-update-squash-is-fixup-only later to maint). @@ -333,3 +337,5 @@ including security updates, are included in this release. (merge 3bdd897413 ms/meson-with-ancient-git-wo-ls-files-dedup later to maint). (merge cca758d324 kh/doc-fast-import-historical later to maint). (merge 9b0781196a jc/test-hashmap-is-still-here later to maint). + (merge 1bad05bacc jk/revert-squelch-compiler-warning later to maint). + (merge 3a7e783d9c dl/squelch-maybe-uninitialized later to maint). diff --git a/GIT-VERSION-GEN b/GIT-VERSION-GEN index 63463c87739aa0..e7e91190ae2d0d 100755 --- a/GIT-VERSION-GEN +++ b/GIT-VERSION-GEN @@ -1,6 +1,6 @@ #!/bin/sh -DEF_VER=v2.50.GIT +DEF_VER=v2.51.0-rc1 LF=' ' diff --git a/archive-zip.c b/archive-zip.c index dbd90d9c3d4b32..bea5bdd43dc43e 100644 --- a/archive-zip.c +++ b/archive-zip.c @@ -492,14 +492,22 @@ static int write_zip_entry(struct archiver_args *args, zstream.next_in = buf; zstream.avail_in = 0; - result = git_deflate(&zstream, Z_FINISH); - if (result != Z_STREAM_END) - die("deflate error (%d)", result); + + do { + result = git_deflate(&zstream, Z_FINISH); + if (result != Z_OK && result != Z_STREAM_END) + die("deflate error (%d)", result); + + out_len = zstream.next_out - compressed; + if (out_len > 0) { + write_or_die(1, compressed, out_len); + compressed_size += out_len; + zstream.next_out = compressed; + zstream.avail_out = sizeof(compressed); + } + } while (result != Z_STREAM_END); git_deflate_end(&zstream); - out_len = zstream.next_out - compressed; - write_or_die(1, compressed, out_len); - compressed_size += out_len; zip_offset += compressed_size; write_zip_data_desc(size, compressed_size, crc); diff --git a/builtin/remote.c b/builtin/remote.c index 43a122740af300..8961ae6a8973c7 100644 --- a/builtin/remote.c +++ b/builtin/remote.c @@ -1474,10 +1474,13 @@ static int set_head(int argc, const char **argv, const char *prefix, }; argc = parse_options(argc, argv, prefix, options, builtin_remote_sethead_usage, 0); - if (argc) { - strbuf_addf(&b_head, "refs/remotes/%s/HEAD", argv[0]); - remote = remote_get(argv[0]); - } + + /* All modes require at least a remote name. */ + if (!argc) + usage_with_options(builtin_remote_sethead_usage, options); + + strbuf_addf(&b_head, "refs/remotes/%s/HEAD", argv[0]); + remote = remote_get(argv[0]); if (!opt_a && !opt_d && argc == 2) { head_name = xstrdup(argv[1]); diff --git a/builtin/revert.c b/builtin/revert.c index e07c2217fe846b..c3f92b585df8c9 100644 --- a/builtin/revert.c +++ b/builtin/revert.c @@ -111,7 +111,7 @@ static int run_sequencer(int argc, const char **argv, const char *prefix, const char * const * usage_str = revert_or_cherry_pick_usage(opts); const char *me = action_name(opts); const char *cleanup_arg = NULL; - const char sentinel_value; + const char sentinel_value = 0; /* value not important */ const char *strategy = &sentinel_value; const char *gpg_sign = &sentinel_value; enum empty_action empty_opt = EMPTY_COMMIT_UNSPECIFIED; diff --git a/t/unit-tests/clar/clar.c b/t/unit-tests/clar/clar.c index d54e4553674908..03a3aa8e873bfc 100644 --- a/t/unit-tests/clar/clar.c +++ b/t/unit-tests/clar/clar.c @@ -350,7 +350,7 @@ static void clar_run_suite(const struct clar_suite *suite, const char *filter) { const struct clar_func *test = suite->tests; - size_t i, matchlen; + size_t i, matchlen = 0; struct clar_report *report; int exact = 0;