]> git.ipfire.org Git - thirdparty/git.git/commit - upload-pack.c
upload-pack: actually use some upload_pack_data bitfields
authorJeff King <peff@peff.net>
Thu, 4 Jun 2020 17:54:38 +0000 (19:54 +0200)
committerJunio C Hamano <gitster@pobox.com>
Thu, 4 Jun 2020 17:58:24 +0000 (10:58 -0700)
commitb5a2068cb1f879b8bff2bfbf99304091d03ce3af
tree586a77664958614133d9c21460b1f518757db75e
parent7a516764a335412f0a96bc536cf1b408515e5ddc
upload-pack: actually use some upload_pack_data bitfields

As we cleanup 'upload-pack.c' by using 'struct upload_pack_data'
more thoroughly, let's actually start using some bitfields of
that struct. These bitfields were introduced in 3145ea957d
("upload-pack: introduce fetch server command", 2018-03-15), but
were never used.

We could instead have just removed the following bitfields
from the struct:

unsigned use_thin_pack : 1;
unsigned use_ofs_delta : 1;
unsigned no_progress : 1;
unsigned use_include_tag : 1;

but using them makes it possible to remove a number of static
variables with the same name and purpose from 'upload-pack.c'.

This is a behavior change, as we accidentally used to let values
in those bitfields propagate from one v2 "fetch" command to
another for ssh/git/file connections (but not for http). That's
fixing a bug, but one nobody is likely to see, because it would
imply the client sending different capabilities for each request.

Helped-by: Jonathan Tan <jonathantanmy@google.com>
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
Acked-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
upload-pack.c