Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Catalogue references to branches with / in them do not work #1729

Closed
timfel opened this issue Jan 11, 2024 · 2 comments · Fixed by #1731
Closed

Catalogue references to branches with / in them do not work #1729

timfel opened this issue Jan 11, 2024 · 2 comments · Fixed by #1731

Comments

@timfel
Copy link
Contributor

timfel commented Jan 11, 2024

The line here prevents refs with slashes in them (which are IME common in many projects) from being used as refs. This prevents the GraalPy catalogue from working

jbang hello@oracle/graalpython/release/graal-vm/24.0 "print(1*4)"

This should resolve https://raw.githubusercontent.com/oracle/graalpython/release/graal-vm/24.0/jbang-catalog.json, but it won't. I think the code should simple be

		} else {
			path = "";
		}
-		String[] names = parts[0].split("/");
+		String[] names = parts[0].split("/", 3);
-		if (names.length > 3) {
-			return null;
-		}
		String org = names[0];
		String repo;
		if (names.length >= 2 && !names[1].isEmpty()) {
@quintesse
Copy link
Contributor

TBH I didn't know this was even possible. We'd have to make sure that this doesn't match other valid URLs but if not this seems like a simple fix.

@timfel
Copy link
Contributor Author

timfel commented Jan 12, 2024

TBH I didn't know this was even possible. We'd have to make sure that this doesn't match other valid URLs but if not this seems like a simple fix.

What other valid URLs are you thinking of? It cannot match any other for github or gitlab, since those are used for the branch names.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants