Skip to content

Conversation

cgwalters
Copy link
Member

Just pass the bits of the new deployment we want down into the checkout function. This lets us reuse the common helper to init a deployment which now always captures the device/inode.

Followup from previous commit.

Just pass the bits of the new deployment we want down into the
checkout function. This lets us reuse the common helper
to init a deployment which now always captures the device/inode.

Followup from previous commit.

Signed-off-by: Colin Walters <walters@verbum.org>
Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

The pull request refactors the checkout_deployment_tree function to be more modular by passing individual parameters (stateroot, csum, deployserial) instead of a full OstreeDeployment object. This change delays the creation of the OstreeDeployment object until after the checkout is complete, leveraging the _ostree_sysroot_new_deployment_object helper for proper initialization, including device and inode capture. The changes improve code clarity and maintainability by centralizing object creation logic.

@cgwalters
Copy link
Member Author

(Incidentally were this all in Rust we'd definitely be using typestate for the various states of a deployment, but typestate in C is so painful)

@cgwalters cgwalters enabled auto-merge July 1, 2025 18:50
Copy link
Member

@jmarrero jmarrero left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@cgwalters cgwalters disabled auto-merge July 7, 2025 14:58
@cgwalters cgwalters merged commit 4dd1188 into ostreedev:main Jul 7, 2025
23 of 25 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants