mirror of
https://github.com/flatpak/flatpak.git
synced 2026-02-04 13:01:24 -05:00
Due to bug #3215 some systems have refs in refs/mirrors/ in addition to the usual refs/remotes/ location. The remote refs are always at least as new as the mirror ones since the repo_pull() invocation in flatpak_dir_pull() which does not use OSTREE_PULL_FLAGS_MIRROR happened after the one that did. Cleaning up these mirror refs is important since otherwise when the remote ref is either updated or removed (by an uninstall) disk space will be leaked since the mirror ref will point to a no longer needed commit. So, remove (almost) all mirror refs during flatpak repair, uninstall, or update operations. And for the uninstall and update operations do it in FlatpakDir so that it happens regardless of if the CLI of libflatpak are used. Also, add a unit test for this. Fixes https://github.com/flatpak/flatpak/issues/3222