Skip to content

Commit

Permalink
fixup! lib/core: Support <remote>: syntax when listing refs
Browse files Browse the repository at this point in the history
  • Loading branch information
jlebon committed Mar 16, 2018
1 parent d07f1bf commit 676ba21
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/libostree/ostree-repo-refs.c
Original file line number Diff line number Diff line change
Expand Up @@ -629,6 +629,12 @@ _ostree_repo_list_refs_internal (OstreeRepo *self,
const char *prefix_path;
const char *path;

/* back-compat for flatpak -- see https://github.com/ostreedev/ostree/pull/1286 */
g_autofree char *refspec_prefix_owned = NULL;
if (g_str_has_suffix (refspec_prefix, ":."))
refspec_prefix = refspec_prefix_owned =
g_strndup (refspec_prefix, strlen (refspec_prefix) - 1);

if (!ostree_parse_refspec (refspec_prefix, &remote, &ref_prefix, error))
return FALSE;

Expand Down
3 changes: 3 additions & 0 deletions tests/test-refs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,9 @@ assert_file_has_content refscount.create6 "^11$"
#Check that we can list just remote refs
${CMD_PREFIX} ostree --repo=repo refs origin: | wc -l > refscount.create7
assert_file_has_content refscount.create7 "^2$" # origin:remote1 origin:local1
#Also support :. for backcompat with flatpak
${CMD_PREFIX} ostree --repo=repo refs origin:. | wc -l > refscount.create8
assert_file_has_content refscount.create8 "^2$" # origin:remote1 origin:local1

echo "ok refs"

Expand Down

0 comments on commit 676ba21

Please sign in to comment.