]> git.ipfire.org Git - thirdparty/git.git/commit - transport.c
Always obtain fetch-pack arguments from struct fetch_pack_args
authorShawn O. Pearce <spearce@spearce.org>
Wed, 19 Sep 2007 04:49:35 +0000 (00:49 -0400)
committerJunio C Hamano <gitster@pobox.com>
Wed, 19 Sep 2007 10:22:31 +0000 (03:22 -0700)
commitfa74052922cf39e5a39ad7178d1b13c2da9b4519
tree2a2383807927a2943ba5a40af1b403ba74edcf0f
parent824d5776c3f275c644c71b8c7e254bd2d7b08071
Always obtain fetch-pack arguments from struct fetch_pack_args

Copying the arguments from a fetch_pack_args into static globals
within the builtin-fetch-pack module is error-prone and may lead
rise to cases where arguments supplied via the struct from the
new fetch_pack() API may not be honored by the implementation.

Here we reorganize all of the static globals into a single static
struct fetch_pack_args instance and use memcpy() to move the data
from the caller supplied structure into the globals before we
execute our pack fetching implementation.  This strategy is more
robust to additions and deletions of properties.

As keep_pack is a single bit we have also introduced lock_pack to
mean not only download and store the packfile via index-pack but
also to lock it against repacking by creating a .keep file when
the packfile itself is stored.  The caller must remove the .keep
file when it is safe to do so.

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin-fetch-pack.c
fetch-pack.h
transport.c