From patchwork Fri May 10 11:24:57 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Patrick Steinhardt X-Patchwork-Id: 13661373 Received: from wfhigh2-smtp.messagingengine.com (wfhigh2-smtp.messagingengine.com [64.147.123.153]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id D9114171085 for ; Fri, 10 May 2024 11:25:01 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=64.147.123.153 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715340303; cv=none; b=K+DQL7iWmSUbWz0kWuliPgcNlwh5z7Htq0uEVFdqIFWKWcBH6d+/jyAY+A3hlCtJjwLM3sSctSFmFe4j5PkK1sAs4OxuS31PRNcwXMdbzWDyD9aNFufxt6d6X+wA64yB4HR/aYSAS9eCLMx95q0G9xR0YhftQbrm3ykRmQ9SjZA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715340303; c=relaxed/simple; bh=4HRggUM6OPFiayHrNNPpeW1M5Jmv2PEghx8vJytQF0g=; h=Date:From:To:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=kTRr3T1DkI5YjVv45wQZ88es8zDm3XThtnXKnL+/QYaFQxkOyFxSIRVPqZ3TRIN2p4mk24htdKzfciBy66veHrOkBnxSmL7GohLGmfIVMHv5JEipjgdpfJc7y+jPDHllh6D9iEgksVBhDTYrIlRSEf9rEW71E2Bz/gMwB3kf1vg= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=pks.im; spf=pass smtp.mailfrom=pks.im; dkim=pass (2048-bit key) header.d=pks.im header.i=@pks.im header.b=odbre1ol; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b=cFvyOykr; arc=none smtp.client-ip=64.147.123.153 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=pks.im Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=pks.im Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=pks.im header.i=@pks.im header.b="odbre1ol"; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="cFvyOykr" Received: from compute2.internal (compute2.nyi.internal [10.202.2.46]) by mailfhigh.west.internal (Postfix) with ESMTP id 00F1318000A0 for ; Fri, 10 May 2024 07:25:00 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute2.internal (MEProxy); Fri, 10 May 2024 07:25:01 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=pks.im; h=cc :content-type:content-type:date:date:from:from:in-reply-to :in-reply-to:message-id:mime-version:references:reply-to:subject :subject:to:to; s=fm3; t=1715340300; x=1715426700; bh=TiAx13ZZQg M9TqFCkT9NZhd6gzjBX6vHOMgIBSlJwFc=; b=odbre1olkKiQQ46bphk4BkJ1oF Xv5I6RO3n1jBSM7tqIpmkrj4soMECex4GlB+OzY7bHPVUDncsxKBIM4ymrHLNIId pYWCgpm16z0EWZLzvt/1x/pg1b2+jyfszUUINicBNZtpjJlpf9WEObMpGhMS6DH2 f+o6sc7hjEQoHXYoHrTO+iNFfWjKO5XMa0KKSa8QYCCpBWDQHzSzT/h0j9d/o3av ttDBhHKAZzw9Ptp9DxxjhkvWvGjz22bkq5V1RCtSmDjyn8+077v21RONcN66pn8M XS5zCu2xpjrCNlIFf39KiN3DpRusOEMFHqX4iyRqgTRNRrKU1cMtF3VyP0MA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type:content-type:date:date :feedback-id:feedback-id:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:subject:subject:to :to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm3; t=1715340300; x=1715426700; bh=TiAx13ZZQgM9TqFCkT9NZhd6gzjB X6vHOMgIBSlJwFc=; b=cFvyOykrYL9Ytp28m7bFXkN7Es+kigaXKugM1favHlOs 3a/wrHQKHOJqvwF6atGhJoYYq3MoL1CJEcdjCUo39nDj2yun49MSEccCkWM2LENF d/jRcaQAMSdpEy1q+NAA+4DSAt4BFGH+gGOAY7cP7wVWqV2TWTJroR1XDp91z9qx 5mPuW4/YJsNYRCXMd9lCfYAZBcJrNobVCwfHJKYwxIku/4MNyUARltMRisxDqTND Lwk4p+kh8fFGI6kSGAWHU5RzsLmfYpSd0klvG/3hkl6Tlq1rSbE3/Ktc9Q8of0GT pi4jN3UJuM2CbByMNIUx5ApTClBLHVtW6eatH0Jmcg== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvledrvdefkedggedtucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucenucfjughrpeffhffvuffkfhggtggujgesghdtre ertddtvdenucfhrhhomheprfgrthhrihgtkhcuufhtvghinhhhrghrughtuceophhssehp khhsrdhimheqnecuggftrfgrthhtvghrnhepheeghfdtfeeuffehkefgffduleffjedthf dvjeektdfhhedvlefgtefgvdettdfhnecuvehluhhsthgvrhfuihiivgeptdenucfrrghr rghmpehmrghilhhfrhhomhepphhssehpkhhsrdhimh X-ME-Proxy: Feedback-ID: i197146af:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA for ; Fri, 10 May 2024 07:24:59 -0400 (EDT) Received: by localhost (OpenSMTPD) with ESMTPSA id ac126b4f (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO) for ; Fri, 10 May 2024 11:24:47 +0000 (UTC) Date: Fri, 10 May 2024 13:24:57 +0200 From: Patrick Steinhardt To: git@vger.kernel.org Subject: [PATCH 07/21] config: make the config source const Message-ID: References: Precedence: bulk X-Mailing-List: git@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: The `struct git_config_source` passed to `config_with_options()` is never modified. Let's mark it as `const` to clarify. Signed-off-by: Patrick Steinhardt --- config.c | 4 ++-- config.h | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/config.c b/config.c index 13cf9eeb16..bc0c005039 100644 --- a/config.c +++ b/config.c @@ -125,7 +125,7 @@ struct config_include_data { config_fn_t fn; void *data; const struct config_options *opts; - struct git_config_source *config_source; + const struct git_config_source *config_source; struct repository *repo; /* @@ -2105,7 +2105,7 @@ static int do_git_config_sequence(const struct config_options *opts, } int config_with_options(config_fn_t fn, void *data, - struct git_config_source *config_source, + const struct git_config_source *config_source, struct repository *repo, const struct config_options *opts) { diff --git a/config.h b/config.h index db8b608064..e66c84520b 100644 --- a/config.h +++ b/config.h @@ -232,7 +232,7 @@ void git_config(config_fn_t fn, void *); * sets `opts.respect_includes` to `1` by default. */ int config_with_options(config_fn_t fn, void *, - struct git_config_source *config_source, + const struct git_config_source *config_source, struct repository *repo, const struct config_options *opts);