Skip to content

Commit d6d3e22

Browse files
committed
Apply @minrk's comments using provider object
1 parent 92c63ba commit d6d3e22

File tree

1 file changed

+3
-7
lines changed

1 file changed

+3
-7
lines changed

binderhub/builder.py

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -254,16 +254,12 @@ async def get(self, provider_prefix, _unescaped_spec):
254254
if ref is None:
255255
error_message = ["Could not resolve ref for %s. Double check your URL." % key]
256256

257-
split_key = key.split("/")
258-
repo_provider = split_key[0].split(":")[0]
259-
resolved_branch = split_key[-1]
260-
261-
if repo_provider == "gh":
257+
if provider.name == "GitHub":
262258
error_message.append('GitHub recently changed default branches from "master" to "main".')
263259

264-
if resolved_branch == "master":
260+
if provider.unresolved_ref == "master":
265261
error_message.append('Did you mean the "main" branch?')
266-
elif resolved_branch == "main":
262+
elif provider.unresolved_ref == "main":
267263
error_message.append('Did you mean the "master" branch?')
268264

269265
else:

0 commit comments

Comments
 (0)