From patchwork Thu Jun 4 17:54:49 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christian Couder X-Patchwork-Id: 11588211 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 250AF90 for ; Thu, 4 Jun 2020 17:55:31 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 0C118207D8 for ; Thu, 4 Jun 2020 17:55:31 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="pYDggUJ/" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730360AbgFDRza (ORCPT ); Thu, 4 Jun 2020 13:55:30 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57116 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730339AbgFDRzY (ORCPT ); Thu, 4 Jun 2020 13:55:24 -0400 Received: from mail-wm1-x341.google.com (mail-wm1-x341.google.com [IPv6:2a00:1450:4864:20::341]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 10721C08C5C0 for ; Thu, 4 Jun 2020 10:55:24 -0700 (PDT) Received: by mail-wm1-x341.google.com with SMTP id r9so6094090wmh.2 for ; Thu, 04 Jun 2020 10:55:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=Rp+KI8HHhRsLIJaPWde4PVHjOxys+D0eD5bN7m2VPPg=; b=pYDggUJ/CMcjkSqCFb4TbLeV4fl4ovippJMgfVE9/lCUvwkuGFXtj8BLAMdM/qKsaX xk3aHT90WYYraNwmTM64E/IbXMMRkj1s3bomhrMJRgS5YPsVQ1LWmbFnokQMcwelSR6i 70sixyiLANzn+ZjD4cMP3hGjH1AdTShLwntoJUqh6zU2AnpMbfVZVE6gJ7gDS/VDQNx0 EmJ9jxmq7VrRPX2PdcP480ojlkwE+C6z+iUVuK6kWuKPrer8YvqkWrkcsqo2WQNDdJuu zgzcPi5Mhh6Z+lSupZUGjpHPktMYGVBsLdgCkReJH6g9b3ycGtYa82hQq/J3tsDAol95 z80w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=Rp+KI8HHhRsLIJaPWde4PVHjOxys+D0eD5bN7m2VPPg=; b=hfd98ekdTeu56eEpaKt/OEdNOTngU9w4dRTKwKJBDLGj/RmpJuR2r+tMEYVYBqyRw6 tx+r9SptBU+EZw4HLH5Os3kpAtr66vsTtRg3I1zxYSIbwqi2IMVAEFCvOpG1yxYogtbJ NU+iQfadvEEwIfV2CfwGg3/abi0g/h2L5vU8u7Ynw2gnPH9IkVxVkyq4yEzaCdeWFlkc pTe/eO+hrRG9z4iul4BS6XOAIbSoZDGVVOjPBSF6shwc/Geg3k3lHOwgQxI3t1jHwPHR dhgpqGGUpRnQAj/nBfywQLTnBRoijFjjq1CmZtJLK49+ivpa23jzUsYzX2cmctgvW/KJ ekqg== X-Gm-Message-State: AOAM5328hpPGULXuJWMfEYT7xuCGgvY/wJpCUdaGc3/46Vg8Vt7tERgc GlikJkwc2muTbczAqM9+27cG67pcPrg= X-Google-Smtp-Source: ABdhPJy1uyBYWXq3xCOzcJal+mo+XUebQZ59KnVJuh36umjVnTuQwnJOcu/jFtT4vudun7txNlwDMQ== X-Received: by 2002:a1c:4b0f:: with SMTP id y15mr5431132wma.83.1591293322482; Thu, 04 Jun 2020 10:55:22 -0700 (PDT) Received: from localhost.localdomain ([185.228.231.251]) by smtp.gmail.com with ESMTPSA id s7sm9173540wrr.60.2020.06.04.10.55.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 04 Jun 2020 10:55:21 -0700 (PDT) From: Christian Couder X-Google-Original-From: Christian Couder To: git@vger.kernel.org Cc: Junio C Hamano , Derrick Stolee , Jeff King , Taylor Blau , Jonathan Tan , Jonathan Nieder , Christian Couder , Christian Couder Subject: [PATCH v3 12/13] upload-pack: move allow_sideband_all to upload_pack_data Date: Thu, 4 Jun 2020 19:54:49 +0200 Message-Id: <20200604175450.17385-13-chriscool@tuxfamily.org> X-Mailer: git-send-email 2.27.0.rc0.26.gf2851482f5 In-Reply-To: <20200604175450.17385-1-chriscool@tuxfamily.org> References: <20200602041657.7132-1-chriscool@tuxfamily.org> <20200604175450.17385-1-chriscool@tuxfamily.org> MIME-Version: 1.0 Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org From: Christian Couder As we cleanup 'upload-pack.c' by using 'struct upload_pack_data' more thoroughly, let's move the 'allow_sideband_all' static variable into this struct. It is used only by protocol v2 code. Signed-off-by: Christian Couder Acked-by: Jeff King Signed-off-by: Junio C Hamano --- upload-pack.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/upload-pack.c b/upload-pack.c index 0d75745d8d..78b10a89ea 100644 --- a/upload-pack.c +++ b/upload-pack.c @@ -55,8 +55,6 @@ static int shallow_nr; static struct object_array extra_edge_obj; static const char *pack_objects_hook; -static int allow_sideband_all; - /* * Please annotate, and if possible group together, fields used only * for protocol v0 or only for protocol v2. @@ -103,6 +101,7 @@ struct upload_pack_data { unsigned done : 1; /* v2 only */ unsigned allow_ref_in_want : 1; /* v2 only */ + unsigned allow_sideband_all : 1; /* v2 only */ }; static void upload_pack_data_init(struct upload_pack_data *data) @@ -1146,7 +1145,7 @@ static int upload_pack_config(const char *var, const char *value, void *cb_data) } else if (!strcmp("uploadpack.allowrefinwant", var)) { data->allow_ref_in_want = git_config_bool(var, value); } else if (!strcmp("uploadpack.allowsidebandall", var)) { - allow_sideband_all = git_config_bool(var, value); + data->allow_sideband_all = git_config_bool(var, value); } else if (!strcmp("core.precomposeunicode", var)) { precomposed_unicode = git_config_bool(var, value); } @@ -1341,7 +1340,7 @@ static void process_args(struct packet_reader *request, } if ((git_env_bool("GIT_TEST_SIDEBAND_ALL", 0) || - allow_sideband_all) && + data->allow_sideband_all) && !strcmp(arg, "sideband-all")) { data->writer.use_sideband = 1; continue;