mirror of
https://github.com/flatpak/flatpak.git
synced 2026-04-03 06:47:19 -04:00
Unfortunately in commit253fcc6e3I broke the build-bundle command so that it is unable to resolve remote refs (as opposed to local ones). This means in the normal case of building a bundle for an app installed from a remote it fails: $ flatpak build-bundle /var/lib/flatpak/repo gnome-calculator.flatpak org.gnome.Calculator stable error: Refspec 'app/org.gnome.Calculator/x86_64/stable' not found This is because flatpak_repo_resolve_rev() interprets a NULL remote name to mean the ref is local (in refs/heads/) but in this case we just don't know which remote it's from. This commit fixes the issue by using ostree_repo_resolve_rev() directly which searches refs/heads/ and refs/remotes/, and if that fails falling back to iterating over refs returned by ostree_repo_list_collection_refs() to catch collection-refs that may be in refs/mirrors/. Also, add a unit test that fails without this patch. Fixes https://github.com/flatpak/flatpak/issues/3026 Closes: #3032 Approved by: alexlarsson (cherry picked from commit5e65174e8d)