diff options
| author | 2020-10-28 09:26:09 +0200 | |
|---|---|---|
| committer | 2020-10-28 09:26:09 +0200 | |
| commit | bbf7a600ca4b657258b46074c00cab1982791613 (patch) | |
| tree | ec31f8d2aeafc65c0116ad3823e50aaeec2aa042 | |
| parent | Used a list of tuples for on_message instead (diff) | |
Update bot/exts/info/code_snippets.py
Co-authored-by: Mark <[email protected]>
| -rw-r--r-- | bot/exts/info/code_snippets.py | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/bot/exts/info/code_snippets.py b/bot/exts/info/code_snippets.py index 1bb00b677..4594c36f2 100644 --- a/bot/exts/info/code_snippets.py +++ b/bot/exts/info/code_snippets.py @@ -49,8 +49,7 @@ class CodeSnippets(Cog): def _find_ref(self, path: str, refs: tuple) -> tuple: """Loops through all branches and tags to find the required ref.""" # Base case: there is no slash in the branch name - ref = path.split('/')[0] - file_path = '/'.join(path.split('/')[1:]) + ref, file_path = path.split('/', 1) # In case there are slashes in the branch name, we loop through all branches and tags for possible_ref in refs: if path.startswith(possible_ref['name'] + '/'): |