Repository navigation
dir: Succeed ensure_repo with allow_empty when system helper fails - #6621
Merged
Merged
Conversation
If _flatpak_dir_ensure_repo is called with allow_empty=true, it is allowed to fail to create the repo, and is supposed to return success in that case. The system helper handles this correctly, but we then call to ensure_repo_opened no matter if the repo actuall exists and return an error when it does not, no matter if allow_empty is set or not. Closes: flatpak#6618
Closed
4 tasks done
smcv
approved these changes
Apr 14, 2026
smcv
left a comment
Collaborator
There was a problem hiding this comment.
I think this is right. I was a bit worried that returning from this function with repo not opened would break callers' assumptions, but the behaviour after this change is to return with self->repo still null, and we were already doing that in the allow_empty && !flatpak_dir_use_system_helper code path if ostree_repo_create() failed, so presumably it must be OK.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
If _flatpak_dir_ensure_repo is called with allow_empty=true, it is allowed to fail to create the repo, and is supposed to return success in that case.
The system helper handles this correctly, but we then call to ensure_repo_opened no matter if the repo actuall exists and return an error when it does not, no matter if allow_empty is set or not.
Closes: #6618