diff --git a/gvfs-helper-client.c b/gvfs-helper-client.c index a9f0a6fc5eb5f5..24d9700b29c397 100644 --- a/gvfs-helper-client.c +++ b/gvfs-helper-client.c @@ -191,35 +191,6 @@ static void gh_client__update_loose_cache(const char *line) odb_loose_cache_add_new_oid(gh_client__chosen_odb, &oid); } -/* - * Update the packed-git list to include the newly created packfile. - */ -static void gh_client__update_packed_git(const char *line) -{ - struct strbuf path = STRBUF_INIT; - const char *v1_filename; - struct packed_git *p; - int is_local; - - if (!skip_prefix(line, "packfile ", &v1_filename)) - BUG("update_packed_git: invalid line '%s'", line); - - /* - * ODB[0] is the local .git/objects. All others are alternates. - */ - is_local = (gh_client__chosen_odb == the_repository->objects->sources); - - strbuf_addf(&path, "%s/pack/%s", - gh_client__chosen_odb->path, v1_filename); - strbuf_strip_suffix(&path, ".pack"); - strbuf_addstr(&path, ".idx"); - - p = add_packed_git(the_repository, path.buf, path.len, is_local); - if (p) - packfile_store_add_pack(the_repository->objects->packfiles, p); - strbuf_release(&path); -} - /* * CAP_OBJECTS verbs return the same format response: * @@ -279,7 +250,6 @@ static int gh_client__objects__receive_response( } else if (starts_with(line, "packfile")) { - gh_client__update_packed_git(line); ghc |= GHC__CREATED__PACKFILE; nr_packfile++; } @@ -300,6 +270,9 @@ static int gh_client__objects__receive_response( } } + if (ghc & GHC__CREATED__PACKFILE) + packfile_store_reprepare(the_repository->objects->packfiles); + *p_ghc = ghc; *p_nr_loose = nr_loose; *p_nr_packfile = nr_packfile; diff --git a/t/t5799-gvfs-helper.sh b/t/t5799-gvfs-helper.sh index 2ca443252e90b3..8fcab959e7b8af 100755 --- a/t/t5799-gvfs-helper.sh +++ b/t/t5799-gvfs-helper.sh @@ -1285,15 +1285,30 @@ test_expect_success 'integration: explicit commit/trees, implicit blobs: diff 2 >OUT.output 2>OUT.stderr ' +trace_has_queue_oid () { + oid=$1 + grep "gh_client__queue_oid: $oid" +} + +trace_has_immediate_oid () { + oid=$1 + grep "gh_client__get_immediate: $oid" +} + test_expect_success 'integration: fully implicit: diff 2 commits' ' test_when_finished "per_test_cleanup" && start_gvfs_protocol_server && # Implicitly demand-load everything without any pre-seeding. # + GIT_TRACE2_EVENT="$(pwd)/diff-trace.txt" \ git -C "$REPO_T1" -c core.useGVFSHelper=true \ diff $(cat m1.branch)..$(cat m3.branch) \ - >OUT.output 2>OUT.stderr + >OUT.output 2>OUT.stderr && + + oid=$(git -C "$REPO_SRC" rev-parse main:file9.txt.t) && + trace_has_queue_oid $oid