lib/pull: Don't request deltas for unchanged commits
I noticed this while debugging why I was seeing "2 metadata objects" fetched for a different PR. I knew 1 was detached meta, but the other turned out to be this. There's no reason to request a delta if the ref is unchanged. Closes: #1220 Approved by: jlebon
This commit is contained in:
parent
3314140415
commit
5b860fba05
|
|
@ -3117,9 +3117,13 @@ initiate_request (OtPullData *pull_data,
|
||||||
g_clear_pointer (&delta_from_revision, g_free);
|
g_clear_pointer (&delta_from_revision, g_free);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* This is similar to the below, except we *might* use the previous
|
/* If the current ref is the same, we don't do a delta request, just a
|
||||||
* commit, or we might do a scratch delta first.
|
* scan. Otherise, use the previous commit if available, or a scratch
|
||||||
|
* delta.
|
||||||
*/
|
*/
|
||||||
|
if (delta_from_revision && g_str_equal (delta_from_revision, to_revision))
|
||||||
|
queue_scan_one_metadata_object (pull_data, to_revision, OSTREE_OBJECT_TYPE_COMMIT, NULL, 0, ref);
|
||||||
|
else
|
||||||
initiate_delta_request (pull_data, delta_from_revision ?: NULL, to_revision, ref);
|
initiate_delta_request (pull_data, delta_from_revision ?: NULL, to_revision, ref);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue