From: Colin Walters Date: Thu, 29 Jun 2017 19:01:16 +0000 (-0400) Subject: lib/pull: Move check for requested content earlier X-Git-Tag: archive/raspbian/2022.1-3+rpi1~1^2~4^2~35^2~10 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=1782a1c2797da38f69b147908d48711ecef8946f;p=ostree.git lib/pull: Move check for requested content earlier This is prep for a later patch; currently the logic is unchanged, but we'll need this if we make local imports async. Closes: #982 Approved by: jlebon --- diff --git a/src/libostree/ostree-repo-pull.c b/src/libostree/ostree-repo-pull.c index fd9e9aff..fb0c9e82 100644 --- a/src/libostree/ostree-repo-pull.c +++ b/src/libostree/ostree-repo-pull.c @@ -702,13 +702,17 @@ scan_dirtree_object (OtPullData *pull_data, if (file_is_stored) continue; + /* Already have a request pending? If so, move on to the next */ + if (g_hash_table_lookup (pull_data->requested_content, file_checksum)) + continue; + /* Is this a local repo? */ if (pull_data->remote_repo_local) { if (!import_one_local_content_object (pull_data, file_checksum, cancellable, error)) return FALSE; } - else if (!g_hash_table_lookup (pull_data->requested_content, file_checksum)) + else { /* In this case we're doing HTTP pulls */ g_hash_table_add (pull_data->requested_content, file_checksum);