lib/pull: Don't fetch detached metadata twice for local pulls
Obviously very minor, but I noticed this while working on `pull --reference`. If we have a local repo, we'll have already done a hardlink and copied the detached metadata too, so there's no reason to request it again via the fetcher path. Closes: #978 Approved by: jlebon
This commit is contained in:
parent
2013db0527
commit
8d586a9da0
|
|
@ -1514,6 +1514,11 @@ scan_one_metadata_object_c (OtPullData *pull_data,
|
||||||
objtype, tmp_checksum, !pull_data->is_untrusted,
|
objtype, tmp_checksum, !pull_data->is_untrusted,
|
||||||
cancellable, error))
|
cancellable, error))
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
/* The import API will fetch both the commit and detached metadata, so
|
||||||
|
* add it to the hash to avoid re-fetching it below.
|
||||||
|
*/
|
||||||
|
if (objtype == OSTREE_OBJECT_TYPE_COMMIT)
|
||||||
|
g_hash_table_add (pull_data->fetched_detached_metadata, g_strdup (tmp_checksum));
|
||||||
}
|
}
|
||||||
is_stored = TRUE;
|
is_stored = TRUE;
|
||||||
is_requested = TRUE;
|
is_requested = TRUE;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue