From 730f7238699b932c90423a63c6720a12643a76b2 Mon Sep 17 00:00:00 2001 From: Colin Walters Date: Tue, 1 Nov 2016 14:17:57 -0400 Subject: [PATCH] repo: Don't put remote refs in the summary file I was doing a chain of mirroring like A -> B -> C And repo B had A as a remote. When I added B as a remote to C, the summary file of B had a ref upstream:foo/bar/baz, which caused all pulls from B to C to fail, since the summary file is only expected to have refs, not refspecs. Closes: https://github.com/ostreedev/ostree/issues/561 Closes: #565 Approved by: jlebon --- src/libostree/ostree-repo.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/libostree/ostree-repo.c b/src/libostree/ostree-repo.c index 1f866bbe..ad629421 100644 --- a/src/libostree/ostree-repo.c +++ b/src/libostree/ostree-repo.c @@ -4668,10 +4668,18 @@ ostree_repo_regenerate_summary (OstreeRepo *self, { const char *ref = iter->data; const char *commit = g_hash_table_lookup (refs, ref); + g_autofree char *remotename = NULL; g_autoptr(GVariant) commit_obj = NULL; g_assert (commit); + if (!ostree_parse_refspec (ref, &remotename, NULL, NULL)) + g_assert_not_reached (); + + /* Don't put remote refs in the summary */ + if (remotename != NULL) + continue; + if (!ostree_repo_load_variant (self, OSTREE_OBJECT_TYPE_COMMIT, commit, &commit_obj, error)) goto out;