lib/repo: Add an API to mark a commit as partial
For the [rpm-ostree jigdo ♲📦](https://github.com/projectatomic/rpm-ostree/issues/1081) work. We're basically doing "pull" via a non-libostree mechanism, and this should be fully supported. As I mentioned earlier we should try to have `ostree-repo-pull.c` only use public APIs; this gets us closer to that. Closes: #1376 Approved by: jlebon
This commit is contained in:
1 parent
ad814d1c8a
commit
7935b881bf
6 files changed
+56
-33
No files matched your search
@@ -36,16 +36,6 @@ typedef struct {
|
||||
guint64 freed_bytes;
|
||||
} OtPruneData;
|
||||
|
||||
static gboolean
|
||||
prune_commitpartial_file (OstreeRepo *repo,
|
||||
const char *checksum,
|
||||
GCancellable *cancellable,
|
||||
GError **error)
|
||||
{
|
||||
g_autofree char *path = _ostree_get_commitpartial_path (checksum);
|
||||
return ot_ensure_unlinked_at (repo->repo_dir_fd, path, error);
|
||||
}
|
||||
|
||||
static gboolean
|
||||
maybe_prune_loose_object (OtPruneData *data,
|
||||
OstreeRepoPruneFlags flags,
|
||||
@@ -68,7 +58,7 @@ maybe_prune_loose_object (OtPruneData *data,
|
||||
|
||||
if (objtype == OSTREE_OBJECT_TYPE_COMMIT)
|
||||
{
|
||||
if (!prune_commitpartial_file (data->repo, checksum, cancellable, error))
|
||||
if (!ostree_repo_mark_commit_partial (data->repo, checksum, FALSE, error))
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user