pull: mark commits from local cache as partial

If one of the localcache repos has the exact same commit we resolved
from the remote, then we need to make sure to mark it as partial so that
we download the full tree.

Closes: #1074

Closes: #1076
Approved by: cgwalters
This commit is contained in:
Jonathan Lebon authored and Atomic Bot committed 2017-08-14 12:04:42 +00:00
1 parent 2522db0164
commit 64b7c42025
3 files changed
+36 -9

No files matched your search

+7
View File
@@ -1790,6 +1790,7 @@ scan_one_metadata_object_c (OtPullData *pull_data,
{
if (objtype == OSTREE_OBJECT_TYPE_COMMIT)
{
/* mark as partial to ensure we scan the commit below */
if (!write_commitpartial_for (pull_data, tmp_checksum, error))
return FALSE;
}
@@ -1819,6 +1820,12 @@ scan_one_metadata_object_c (OtPullData *pull_data,
return FALSE;
if (!localcache_repo_has_obj)
continue;
if (objtype == OSTREE_OBJECT_TYPE_COMMIT)
{
/* mark as partial to ensure we scan the commit below */
if (!write_commitpartial_for (pull_data, tmp_checksum, error))
return FALSE;
}
if (!ostree_repo_import_object_from_with_trust (pull_data->repo, refd_repo,
objtype, tmp_checksum,
!pull_data->is_untrusted,