🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: linux.kernel.git
Article #4219

[PATCH v2 2/5] builtin/multi-pack-index: get rid of `the_repository`

#4219
From: Justin Tobler
Date: Tue, 01 Dec 2026 18:16
106 lines
14126 bytes
There are a couple of remaining references to `the_repository` in
git-multi-pack-index(1). Replace them with the repository that is passed
to the builtin and its subcommands.

Note that the repository may still be `NULL` until `parse_options()` has
been called. The only use of the repository before that point is
`repo_config()`, which handles a `NULL` repository.

Signed-off-by: Justin Tobler <jltobler@gmail.com>
---
 builtin/multi-pack-index.c | 19 +++++++++----------
 1 file changed, 9 insertions(+), 10 deletions(-)

diff --git a/builtin/multi-pack-index.c b/builtin/multi-pack-index.c
index ba5f326dd6ef..c1ad8ebbcc15 100644
--- a/builtin/multi-pack-index.c
+++ b/builtin/multi-pack-index.c
@@ -1,4 +1,3 @@
-#define USE_THE_REPOSITORY_VARIABLE
 #include "builtin.h"
 #include "config.h"
 #include "environment.h"
@@ -164,7 +163,7 @@ static int cmd_multi_pack_index_write(int argc, const char **argv,
 
 	opts.flags |= MIDX_WRITE_BITMAP_HASH_CACHE;
 
-	repo_config(the_repository, git_multi_pack_index_write_config, NULL);
+	repo_config(repo, git_multi_pack_index_write_config, NULL);
 
 	options = add_common_options(builtin_multi_pack_index_write_options);
 
@@ -270,7 +269,7 @@ static int cmd_multi_pack_index_compact(int argc, const char **argv,
 				   options);
 	}
 
-	packed_source = handle_object_dir_option(the_repository);
+	packed_source = handle_object_dir_option(repo);
 
 	FREE_AND_NULL(options);
 
@@ -305,7 +304,7 @@ static int cmd_multi_pack_index_compact(int argc, const char **argv,
 
 static int cmd_multi_pack_index_verify(int argc, const char **argv,
 				       const char *prefix,
-				       struct repository *repo UNUSED)
+				       struct repository *repo)
 {
 	struct option *options;
 	static struct option builtin_multi_pack_index_verify_options[] = {
@@ -325,7 +324,7 @@ static int cmd_multi_pack_index_verify(int argc, const char **argv,
 	if (argc)
 		usage_with_options(builtin_multi_pack_index_verify_usage,
 				   options);
-	packed_source = handle_object_dir_option(the_repository);
+	packed_source = handle_object_dir_option(repo);
 
 	FREE_AND_NULL(options);
 
@@ -334,7 +333,7 @@ static int cmd_multi_pack_index_verify(int argc, const char **argv,
 
 static int cmd_multi_pack_index_expire(int argc, const char **argv,
 				       const char *prefix,
-				       struct repository *repo UNUSED)
+				       struct repository *repo)
 {
 	struct option *options;
 	static struct option builtin_multi_pack_index_expire_options[] = {
@@ -354,7 +353,7 @@ static int cmd_multi_pack_index_expire(int argc, const char **argv,
 	if (argc)
 		usage_with_options(builtin_multi_pack_index_expire_usage,
 				   options);
-	packed_source = handle_object_dir_option(the_repository);
+	packed_source = handle_object_dir_option(repo);
 
 	FREE_AND_NULL(options);
 
@@ -363,7 +362,7 @@ static int cmd_multi_pack_index_expire(int argc, const char **argv,
 
 static int cmd_multi_pack_index_repack(int argc, const char **argv,
 				       const char *prefix,
-				       struct repository *repo UNUSED)
+				       struct repository *repo)
 {
 	struct option *options;
 	static struct option builtin_multi_pack_index_repack_options[] = {
@@ -386,7 +385,7 @@ static int cmd_multi_pack_index_repack(int argc, const char **argv,
 	if (argc)
 		usage_with_options(builtin_multi_pack_index_repack_usage,
 				   options);
-	packed_source = handle_object_dir_option(the_repository);
+	packed_source = handle_object_dir_option(repo);
 
 	FREE_AND_NULL(options);
 
@@ -412,7 +411,7 @@ int cmd_multi_pack_index(int argc,
 
 	disable_replace_refs();
 
-	repo_config(the_repository, git_default_config, NULL);
+	repo_config(repo, git_default_config, NULL);
 
 	argc = parse_options(argc, argv, prefix, options,
 			     builtin_multi_pack_index_usage, 0);
-- 
2.56.0
Technical Details
Message-ID: <28d7916f0a24c2cc382f86940af0459bf85b9a6e.1796147221.git.jltobler@gmail.com>
Path: mbox-mo1.pugleaf.net!news-lon.pugleaf.net!srl.newsdeef.eu!news.mb-net.net!open-news-network.org!2.eu.feeder.erje.net!feeder.erje.net!feeder1.feed.ams11.usenet.farm!feed.usenet.farm!feeder.usenetexpress.com!tr3.eu1.usenetexpress.com!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!git+bounces-76815-linux-kernel-git=dewy.ru
References: <cover.1796147221.git.jltobler@gmail.com>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!news-lon.pugleaf.net!srl.newsdeef.eu!news.mb-net.net!open-news-network.org!2.eu.feeder.erje.net!feeder.erje.net!feeder1.feed.ams11.usenet.farm!feed.usenet.farm!feeder.usenetexpress.com!tr3.eu1.usenetexpress.com!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!git+bounces-76815-linux-kernel-git=dewy.ru
From: jltobler@gmail.com (Justin Tobler)
Newsgroups: linux.kernel.git
Subject: [PATCH v2 2/5] builtin/multi-pack-index: get rid of `the_repository`
Date: Tue,  1 Dec 2026 12:16:13 -0600
Organization: Usenet Network
Message-ID: <28d7916f0a24c2cc382f86940af0459bf85b9a6e.1796147221.git.jltobler@gmail.com>
References: <cover.1796147221.git.jltobler@gmail.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
Injection-Info: usenet.network; logging-data="1787008"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:I9Oo5KYVS49hy3mdUR8ufcOQxYs= sha256:7OyysK27y1ajvhjMCzq0oouhAI3Drxp7ujaYwMcN0tY= sha1:rN/8s/oiVXFqcFJRXnNkfc9JL58= sha256:G36VxCYnn/X56HhThgsB64ZRg6azPv/azbIz4y1eGfU=
List-ID: <git.vger.kernel.org>
X-Mailpost-Empty-Hdrs: X-Spam-Level
X-Received: from localhost (localhost [127.0.0.1]) by mail.dewy.ru (Postfix) with ESMTP id 503B411745B; Tue,  1 Dec 2026 21:20:15 +0300 (MSK)
X-Virus-Scanned: Debian amavisd-new at usenet.network
X-Spam-Flag: NO
X-Spam-Score: -3.049
X-Spam-Status: No, score=-3.049 tagged_above=-9999 required=6.31 tests=[DCC_REPUT_70_89=0.1, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.001, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.249, MAILING_LIST_MULTI=-1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, SPF_PASS=-0.001] autolearn=ham autolearn_force=no
X-Authentication-Results: mail.dewy.ru (amavisd-new); dkim=pass (2048-bit key) header.d=gmail.com
X-Received: from mail.dewy.ru ([127.0.0.1]) by localhost (mail.dewy.ru [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id DXjW_MsR5RO7; Tue,  1 Dec 2026 21:20:12 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.234.253.10; helo=sea.lore.kernel.org; envelope-from=git+bounces-76815-linux-kernel-git=dewy.ru@vger.kernel.org; receiver=<UNKNOWN>
X-Authentication-Results: OpenDMARC; dmarc=fail (p=none dis=none) header.from=gmail.com
X-Received: from sea.lore.kernel.org (sea.lore.kernel.org [172.234.253.10]) by mail.dewy.ru (Postfix) with ESMTPS id 1EA53117456; Tue,  1 Dec 2026 21:20:03 +0300 (MSK)
X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92]) by sea.lore.kernel.org (Postfix) with ESMTP id 732B82CC2B; Tue,  1 Dec 2026 18:19:57 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org; arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1
X-ARC-Seal: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=pass; t=1796149195; b=CadE/qrPYyJvMcnkULj7PXJTe5AkCYs3eeRqlM4qYqnl4OgKchlCoWvVEZgIjHhgCGju yo4yQS7jCGw21B/ytDIRg5K+2SyIJnwi9ZtnGtyY5k1XqIBI8RQLQJ5sab454Z5jmxoYs 3hfxAzmVIdlPDJchhnYAoTZ5m4ihVbM9PIu2Dlu9BQBSN0tIP4wrnME0DuhEweI7kYiZx pdNHMUwroh2wKFWpOFGCR+iBcmR4lEcL0PknUeRWtpr8Qyhv/CSnFbaYZGyT9dUOoBhrn Xf6meZNIbzbkMyUbBKZckM6lbaJhQ2ahnlGqZgNBoYBx9MGzbadtgP4boH2NQHSmkng==
X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796149195; h=X-Original-To:Received:DMARC-Filter:Received:DKIM-Signature: X-Google-DKIM-Signature:X-Gm-Message-State:X-Gm-Gg:X-Received: Received:From:To:Cc:Subject:Date:Message-ID:X-Mailer:In-Reply-To: References:X-Mailing-List:List-Id:List-Post:List-Help:List-Subscribe: List-Unsubscribe:List-Owner:Precedence:MIME-Version: Content-Transfer-Encoding; bh=vwGW83c2PlSj2BQ1XKEOa/rDnHk+y340awpdaU2j0Os=; b=CB6U9xdTmpOIRdc4mcjBh0tb6718+g4oZad4Sf8rdlH5XIJC6QD96bNbO0euRdKWBQcm 5P5qxCLpT/9cspxGUBpYsXcxDGHS8j3p2YNUdMnYr8wbYZm5MXk2bAGfK7g7OAPVHmW9G 2wW2C9OJns0UyW9gKdjZWCG9CVTij/OsV9O7AUOB7lAqCb8xqXQcTeB6jQf6Lpq/9eWRY ZNC/oaMwnRwpAucYuPM8ZiBCfzcRjsD4EocUjTbwvTh99/Lg8GjbTqmWNVMhnWjHy647I ZMmwMTLlkMmG+pJUdAvAb2Bvv44PxU8igAQQuLDft8D+kz2pwxVzTeM2tIC5wUTntmg==
X-ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dkim=pass header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20260707 header.b="FJ/TiEHo"; dmarc=pass header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1
X-Received: from localhost.localdomain (localhost [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 78335606A337; Tue,  1 Dec 2026 18:19:55 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20260707 header.b=FJ/TiEHo
X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=209.85.210.45
X-ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796149194; b=2xm2AT3WGhU4/cVdLxsEcbWWhaGXGityEiLoDq8J3xs6ibSXvJPTRsV8LBafREe/NaWa ooUpIvHKx228B2g4gwh9NMLUisL8eG0h8fViCy9rVUypS3Krno8cNviWwWeUJ8Ef7D8q8 sv1Xt/jDUJ3s6VLOUb/EXSBOSulfhTfMsD1gmUCZTwneeasyAwTW3hqHNc4bvkopxmQP4 El/bK8e/TKCJ9wmdMrKhuVAfFxhv3pYBn9ErxDe5YFFb0FSpXylZ2NEQ0AQBchx9rVqt8 EKKF07e2w358i3mpInhsAIy8yBoNT6aXgnHSmGhN+yMFbbGIa77st2P1JgLGXTDKTEw==
X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796149194; h=DMARC-Filter:Received:DKIM-Signature:X-Google-DKIM-Signature: X-Gm-Message-State:X-Gm-Gg:X-Received:Received:From:To:Cc:Subject: Date:Message-ID:X-Mailer:In-Reply-To:References:MIME-Version: Content-Transfer-Encoding; bh=vwGW83c2PlSj2BQ1XKEOa/rDnHk+y340awpdaU2j0Os=; b=Lv1BeV1yGsqLET1cyVhoyqjxohg7ZV68752qIT6rphzvwcR9WDclcw7lTSb12hl90B6Y 5dK/MAohMAMd/dfnpPcNdgkmPrCEJe5EcA0pXn3nGRsCcbmvQkS46zBa8uv58wyPL7aFP 5iFGlcTG/g5Vjx0F7hi6T7lNhP7mYdChvPWW8zkvF1WAhwNIN9C/N+5PQYtuDZU1qIVxU ia63zK1bz3SkAskc2puAR2M7nIgZhD5cRbjuCQHEBDaUuTuhQ3m0wbrrHGUiduUjlYnIm fuuFF5deZ4vdzqA75NmkOJ5TAbvMo2kR0KQDDhpQlsQ46UD4Kh0IcsHb/xW+JSnOOPQ==
X-ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20260707 header.b="FJ/TiEHo"; arc=none smtp.remote-ip=209.85.210.45
X-Received: from mail-ot1-f45.google.com (mail-ot1-f45.google.com [209.85.210.45]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 4F58C606A334 for <git@vger.kernel.org>; Tue,  1 Dec 2026 18:19:54 +0000 (UTC)
X-DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 4F58C606A334
X-Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com
X-Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com
X-Received: by mail-ot1-f45.google.com with SMTP id 46e09a7af769-862aca1ed4dso4637932a34.0 for <git@vger.kernel.org>; Tue, 01 Dec 2026 10:19:54 -0800 (PST)
X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20260707; t=1796149193; x=1796753993; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to:content-type; bh=vwGW83c2PlSj2BQ1XKEOa/rDnHk+y340awpdaU2j0Os=; b=FJ/TiEHoWvCfECfBf623KDf5XPaANem7vFfCixrfJzm/LuA4sEMcHsBA3g9Ff9iYhC AA4O03rpslbtqY+10uyPfKYbW5iJJ+aorz0yJrQWfkeE4X0j8KnoejRubbJvjUqUOmNd 6cywM9uBMinTC6XQeZzFNCqUcMZ/aNNYgld3NMP0gv76uoSOaYO6hnUkM9X7iU4yxT1W 4rAFwHsWPmRoH59X2gS9SRLqOtyv12rMWGo01ZaGC1R2oF4uYyVgTur3RFcstv9H6fxI yjG354C6xjdOVS8ibCfrWdosk1n9koCdDtOjW401wniDsGhDAXrf9M4PIjv43mX2cC8k miQg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1796149193; x=1796753993; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to:content-type; bh=vwGW83c2PlSj2BQ1XKEOa/rDnHk+y340awpdaU2j0Os=; b=v1pt56ehfvxp5HmNWCfhEe51eMTxwTBHSWfEo8jY+x9FGm4uF0BKUwQetdFr9ZPGMb QCkE6iibhrRY/1wAJ4FMaWZx4wRGalTrLAz0qpiAfeW2WY82pKqs2wHy1QxmWuYLVIpg UrVMox0nBBZFwoXMQ2ryxjHnWJ2ZRikjeNHfJ3ADr7ZRcuXXatQIqC6oZNHDqef6Xeuf nJoAfOVGi/sPlpPDNGyO0+vTuxmnDpWHWNPQ5ax9JS7SQvCTj3gFMmaraY8VS/5OCimB DmHEfL7pQfUzh4RLkahefaqApz6OF0Y6h/Ykz2KJybciWAAdARmFfGsdqhsX9UD9vQJt yUmg==
X-Gm-Message-State: APuU4Z80GD7NjxhTcsAE3iBRAJzR9JdyNVK+uqvwSKxBh7fd7RO9n0U7 y1/Vf+z/uzhC08e5JUtxFs1ewejw8NkJLZsNejTAurL8yuGJ37DxINMBiRnBtA==
X-Gm-Gg: AZFdTZfO8e0V9qiewURxGwbiKmT9UfgEEiMiL2VTnhHsjE89Wk6O6op09FAuUEjCUk4 xTM+bm5nsCQZKgBmQsjjXgDgw4TrndrD0xdBZHMv/T6Jn4e73nVanqbzVu3BO5PBNfSUP8jRah4 mn6uvsZTJ0PZaFGcYQDuxXEcgb4vqSwfJh6DMGNdHZP7BLTZLvIfaBCftslEQ11kBaD/uRuGq7R pdZ+wdvVixODlCnZL1VFvnTlR4xQZwalJnIj6EnAnSQrrjUC4XKO4R4IISQGOyAgVFeZZqez9Ej poH77SoSb0wO2zXGjVxfUXFIKSDYXaYF0zwDP4s5C8MFWLG9KuqsEY3gPQyzFv4gygS0+OW69ep uE9j1kJltPhPNv8IF8qCv5v3C9dAknS/vLDOejHymxf0IIqvjO+vTEyyDXPc3WWTLterb2Cz996 Os49vkgUjBMpAiiFATo5kvuCOjVeJH9PjYNZ/8kDrKEXmsWcIWgZtlsxpgSBOxbIQuAgdTNERuC 5IxUK3+94201Jnx+sS4IaJHBW+uWpnWnFUG4hF/6WYPhY4ukzUXoySY3qNnXOQESh4sG4d8l8P7 2U+y5wtTW2KMTsA78oN7CtTN39vdrDINK8QM4H1QLMbz2Rwg5nX9FNuQXYng/ERvl2Q536OQruF ia95fx+lYaaj0W7ibJJ6yifHrTd/3TtuGwg==
X-Received: by 2002:a05:6830:b14:b0:861:69b7:9a2e with SMTP id 46e09a7af769-8631549103cmr40400767a34.10.1796149193185; Tue, 01 Dec 2026 10:19:53 -0800 (PST)
X-Received: from jtobler--20250820-SHC54.localdomain ([136.51.44.64]) by smtp.gmail.com with ESMTPSA id 46e09a7af769-863607d0f48sm16701271a34.7.2026.12.01.10.19.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 01 Dec 2026 10:19:52 -0800 (PST)
X-Cc: ps@pks.im, Justin Tobler <jltobler@gmail.com>
X-Mailer: git-send-email 2.56.0
X-In-Reply-To: <cover.1796147221.git.jltobler@gmail.com>
X-Mailing-List: git@vger.kernel.org
X-List-Post: <mailto:git@vger.kernel.org>
X-List-Help: <mailto:git+help@vger.kernel.org>
X-List-Subscribe: <mailto:git+subscribe@vger.kernel.org>
X-List-Unsubscribe: <mailto:git+unsubscribe@vger.kernel.org>
X-List-Owner: <mailto:git+owner@vger.kernel.org>
X-Precedence: list