From 3dede707a0e246d1c755c04b89df466d64da5725 Mon Sep 17 00:00:00 2001 From: Derrick Stolee Date: Thu, 12 Mar 2020 12:48:49 +0000 Subject: [PATCH] fetch: reprepare packs before checking connectivity Signed-off-by: Derrick Stolee --- builtin/fetch.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/builtin/fetch.c b/builtin/fetch.c index 4bf13b4e83b398..8afa291186b3df 100644 --- a/builtin/fetch.c +++ b/builtin/fetch.c @@ -20,6 +20,7 @@ #include "transport.h" #include "gvfs.h" #include "gvfs-helper-client.h" +#include "packfile.h" #include "run-command.h" #include "parse-options.h" #include "sigchain.h" @@ -1153,6 +1154,13 @@ static int store_updated_refs(struct display_state *display_state, opt.exclude_hidden_refs_section = "fetch"; rm = ref_map; + + /* + * Before checking connectivity, be really sure we have the + * latest pack-files loaded into memory. + */ + reprepare_packed_git(the_repository); + if (check_connected(iterate_ref_map, &rm, &opt)) { rc = error(_("%s did not send all necessary objects\n"), display_state->url);