Skip to content

Conversation

qiuzhiqian
Copy link
Contributor

Unable to delete all refs under the specified remote by remote name

$ mkdir test
$ touch "test123" > test/123
$ ostree init --repo repo --mode bare
$ ostree commit --repo repo --tree=dir=test --branch remote:test/123
f90912dab0abdab05c0ee40285a01ec06d3bfe0d4c9b3f9a2de0778a1f580561
$ ostree refs --repo repo
remote:test/123
$ ostree refs --repo repo --delete remote:
error: Invalid refspec remote:./test/123

In the call to enumerate_refs_recurse, for the remote case, ref_prefix will be set to ., which will result in ./ being added to each branch path. However, ref with ./ as a prefix are not valid.

Copy link

openshift-ci bot commented Sep 8, 2025

Hi @qiuzhiqian. Thanks for your PR.

I'm waiting for a ostreedev member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request correctly fixes an issue where deleting all refs for a given remote would fail due to an invalid path prefix. The change in src/libostree/ostree-repo-refs.c to strip the leading ./ is a direct and effective solution. A new test case has been added to tests/test-refs.sh to cover this scenario, which is great. However, I've found a small issue in the new test script that needs to be addressed to ensure it validates the fix correctly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant