git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH 2/2] fsck: use local repository

From
Derrick Stolee via GitGitGadget <gitgitgadget@gmail.com>
Date
May 1, 2023, 18:21 UTC
Message-ID
<2162a352a46dc0c40afccc4defc88a1e8940ce6c.1682965296.git.gitgitgadget@gmail.com>
In-Reply-To
<pull.1526.git.1682965295.gitgitgadget@gmail.com>
From: Derrick Stolee <derrickstolee@github.com>

In 0d30feef3c5 (fsck: create scaffolding for rev-index checks, 2023-04-17) and later 5a6072f631d (fsck: validate .rev file header, 2023-04-17), the check_pack_rev_indexes() method was created with a 'struct repository *r' parameter. However, this parameter was unused and instead 'the_repository' was used in its place.

Fix this situation with the obvious replacement.
Signed-off-by: Derrick Stolee <derrickstolee@github.com>
---
 builtin/fsck.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/builtin/fsck.c b/builtin/fsck.c
index 75b30d1d00c..dcc165bf0c5 100644
--- a/builtin/fsck.c
+++ b/builtin/fsck.c
@@ -869,20 +869,20 @@ static int check_pack_rev_indexes(struct repository *r, int show_progress)
 	int res = 0;
 
 	if (show_progress) {
-		for (struct packed_git *p = get_all_packs(the_repository); p; p = p->next)
+		for (struct packed_git *p = get_all_packs(r); p; p = p->next)
 			pack_count++;
 		progress = start_delayed_progress("Verifying reverse pack-indexes", pack_count);
 		pack_count = 0;
 	}
 
-	for (struct packed_git *p = get_all_packs(the_repository); p; p = p->next) {
+	for (struct packed_git *p = get_all_packs(r); p; p = p->next) {
 		int load_error = load_pack_revindex_from_disk(p);
 
 		if (load_error < 0) {
 			error(_("unable to load rev-index for pack '%s'"), p->pack_name);
 			res = ERROR_PACK_REV_INDEX;
 		} else if (!load_error &&
-			   !load_pack_revindex(the_repository, p) &&
+			   !load_pack_revindex(r, p) &&
 			   verify_pack_revindex(p)) {
 			error(_("invalid rev-index for pack '%s'"), p->pack_name);
 			res = ERROR_PACK_REV_INDEX;
-- 
gitgitgadget
Previous: Derrick Stolee via GitGitGadgetNext: Junio C Hamano
Message 2 of 8 in “fsck: verify .bitmap checksums, cleanup”
  1. 0/2 fsck: verify .bitmap checksums, cleanupDerrick Stolee via GitGitGadget, May 1, 2023
  2. 2/2 fsck: use local repositoryDerrick Stolee via GitGitGadget, May 1, 2023
  3. Junio C HamanoMay 1, 2023
  4. 1/2 fsck: verify checksums of all .bitmap filesDerrick Stolee via GitGitGadget, May 1, 2023
  5. Junio C HamanoMay 1, 2023
  6. 0/2 fsck: verify .bitmap checksums, cleanupDerrick Stolee via GitGitGadget, May 2, 2023
  7. 1/2 fsck: verify checksums of all .bitmap filesDerrick Stolee via GitGitGadget, May 2, 2023
  8. 2/2 fsck: use local repositoryDerrick Stolee via GitGitGadget, May 2, 2023

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.