From 3eb3cf18e6cb08e64c439eb3e71b24f72690484f Mon Sep 17 00:00:00 2001 From: Derrick Stolee Date: Tue, 18 Nov 2025 12:59:53 -0500 Subject: [PATCH 1/2] fixup! gvfs-helper: create tool to fetch objects using the GVFS Protocol This fixup updates b46ad0ac29 (gvfs-helper: create tool to fetch objects using the GVFS Protocol, 2019-08-13) in reaction to f6f236d926 (packfile: refactor `install_packed_git()` to work on packfile store, 2025-09-23) which is included in Git 2.52.0. The refactored packfile store includes an automatic inclusion of new packifles into the MRU list. This introduces a bug in microsoft/git's use of the GVFS protocol in the following scenario in 'git fetch': 1. If the prefetch downloads at least one prefetch packfile, then it is added to the MRU list twice, creating an infinite loop. 2. If the refs that are updated include commits that are not present in the packfile list, then the MRU lookup will iterate through without interruption, hitting the infinite loop. The fix is to modify this patch to no longer include a custom "add to MRU" method now that the default implementation does this for us. Signed-off-by: Derrick Stolee --- gvfs-helper-client.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gvfs-helper-client.c b/gvfs-helper-client.c index 858ec350772b68..a9f0a6fc5eb5f5 100644 --- a/gvfs-helper-client.c +++ b/gvfs-helper-client.c @@ -216,7 +216,7 @@ static void gh_client__update_packed_git(const char *line) p = add_packed_git(the_repository, path.buf, path.len, is_local); if (p) - packfile_store_add_pack_also_to_mru(the_repository, p); + packfile_store_add_pack(the_repository->objects->packfiles, p); strbuf_release(&path); } From 13b8048f2de9cdca10d94a944dd97524b1eaeb61 Mon Sep 17 00:00:00 2001 From: Derrick Stolee Date: Tue, 18 Nov 2025 13:18:39 -0500 Subject: [PATCH 2/2] fixup! packfile: add install_packed_git_and_mru() This makes the commit trivial and will be dropped in a future update. Signed-off-by: Derrick Stolee --- packfile.c | 8 -------- packfile.h | 7 ------- 2 files changed, 15 deletions(-) diff --git a/packfile.c b/packfile.c index 1a74bdb7c5cae2..9fa6b8c97057ab 100644 --- a/packfile.c +++ b/packfile.c @@ -792,14 +792,6 @@ void packfile_store_add_pack(struct packfile_store *store, hashmap_add(&store->map, &pack->packmap_ent); } -void packfile_store_add_pack_also_to_mru(struct repository *r, - struct packed_git *pack) -{ - packfile_store_add_pack(r->objects->packfiles, pack); - list_add(&pack->mru, - packfile_store_get_packs_mru(r->objects->packfiles)); -} - struct packed_git *packfile_store_load_pack(struct packfile_store *store, const char *idx_path, int local) { diff --git a/packfile.h b/packfile.h index a19587e57d1388..1b7e0ef74e11d1 100644 --- a/packfile.h +++ b/packfile.h @@ -135,13 +135,6 @@ void packfile_store_reprepare(struct packfile_store *store); */ void packfile_store_add_pack(struct packfile_store *store, struct packed_git *pack); -/* - * Add the pack to the store so that contained objects become accessible via - * the store, and then mark it as most recently used. This moves ownership into - * the store. - */ -void packfile_store_add_pack_also_to_mru(struct repository *r, - struct packed_git *pack); /* * Load and iterate through all packs of the given repository. This helper