Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJonathan Tan <jonathantanmy@google.com>2019-10-08 21:37:39 +0300
committerJunio C Hamano <gitster@pobox.com>2019-10-09 04:46:41 +0300
commitd8bc1a518accaecde83b50288c4591f838401162 (patch)
treee95072bcea4e1929fbdcc3834e79abf7a08b3342 /send-pack.c
parentb744c3af07a15aaeb1b82fab689995fd5528f120 (diff)
send-pack: never fetch when checking exclusions
When building the packfile to be sent, send_pack() is given a list of remote refs to be used as exclusions. For each ref, it first checks if the ref exists locally, and if it does, passes it with a "^" prefix to pack-objects. However, in a partial clone, the check may trigger a lazy fetch. The additional commit ancestry information obtained during such fetches may show that certain objects that would have been sent are already known to the server, resulting in a smaller pack being sent. But this is at the cost of fetching from many possibly unrelated refs, and the lazy fetches do not help at all in the typical case where the client is up-to-date with the upstream of the branch being pushed. Ensure that these lazy fetches do not occur. Signed-off-by: Jonathan Tan <jonathantanmy@google.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'send-pack.c')
-rw-r--r--send-pack.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/send-pack.c b/send-pack.c
index 6dc16c3211..34c77cbb1a 100644
--- a/send-pack.c
+++ b/send-pack.c
@@ -40,7 +40,8 @@ int option_parse_push_signed(const struct option *opt,
static void feed_object(const struct object_id *oid, FILE *fh, int negative)
{
- if (negative && !has_object_file(oid))
+ if (negative &&
+ !has_object_file_with_flags(oid, OBJECT_INFO_SKIP_FETCH_OBJECT))
return;
if (negative)