aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Andi Qu <[email protected]>2020-10-28 09:26:09 +0200
committerGravatar GitHub <[email protected]>2020-10-28 09:26:09 +0200
commitbbf7a600ca4b657258b46074c00cab1982791613 (patch)
treeec31f8d2aeafc65c0116ad3823e50aaeec2aa042
parentUsed 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.py3
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'] + '/'):