radicle-dev / radicle-surf

A code browsing library for VCS file systems.
Other
32 stars 11 forks source link

Remote branches containing slashes are not listed. #191

Closed geigerzaehler closed 3 years ago

geigerzaehler commented 3 years ago

Assume we have a repo with the following ref: refs/remotes/banana/orange/lemon. I’d expect orange/lemon to be included in the result of

browser.list_branches(BranchSelector::Remote { name: Some("banana".to_string()) })?;

The current behavior is that orange/lemon is not included.

The culprit is the single star glob * at the end here. Changing this to a double-start glob is not straight-forward though. This would also mean that the internal rad/self branches are listed by radicle-source.

FintanH commented 3 years ago

I beg to differ :upside_down_face: https://github.com/radicle-dev/radicle-surf/pull/194

Could it be the case that this happens when we're under a namespace?

geigerzaehler commented 3 years ago

194 passes because we’re using BranchSelector::All. This uses ** as the remote in the glob refs/namespaces/<ns>/**/*. And this coincidentally matches all branches. If we use BranchSelector::Remote (like we do in upstream) branches with slashes are not listed. I created a failing test case in #195.

FintanH commented 3 years ago

Ah perfect, thanks for creating the failing case!

FintanH commented 3 years ago

I believe it might actually be a parsing issue in the TryFrom impl for Branch

geigerzaehler commented 3 years ago

False alarm. This does actually work: https://github.com/radicle-dev/radicle-surf/blob/eff4cf3d9685f9eb051c864c00b62bbeb21da7a9/surf/src/vcs/git.rs#L1218-L1221

Seems like me problem originated from somewhere else.