sysroot: Cleanup refs and prune even on last undeployment

I was working on a different test, and ended up being very confused at
the behavior where removing the last deployment didn't remove the last
`ostree/X/X/X` ref pointing to its commit.

There's no reason to special case the last undeployment AFAIK, and the
existing code handles this.
This commit is contained in:
Colin Walters committed 2015-09-24 12:25:23 -04:00
1 parent e21188a245
commit bab6503b69
3 files changed
+50 -15

No files matched your search

+12 -15
View File
@@ -570,23 +570,20 @@ _ostree_sysroot_piecemeal_cleanup (OstreeSysroot *self,
goto out;
}
if (self->deployments->len > 0)
if (!ostree_sysroot_get_repo (self, &repo, cancellable, error))
goto out;
if (!generate_deployment_refs (self, repo,
self->bootversion,
self->subbootversion,
self->deployments,
cancellable, error))
goto out;
if (flags & OSTREE_SYSROOT_CLEANUP_PRUNE_REPO)
{
if (!ostree_sysroot_get_repo (self, &repo, cancellable, error))
goto out;
if (!generate_deployment_refs (self, repo,
self->bootversion,
self->subbootversion,
self->deployments,
cancellable, error))
goto out;
if (flags & OSTREE_SYSROOT_CLEANUP_PRUNE_REPO)
{
if (!prune_repo (repo, cancellable, error))
if (!prune_repo (repo, cancellable, error))
goto out;
}
}
ret = TRUE;