aboutsummaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
authorGravatar jesopo2019-01-23 08:56:36 +0000
committerGravatar jesopo2019-01-23 08:56:36 +0000
commit756938a4c9c0e2a81c48340bfe37c48cf544cffe (patch)
treecd798714f228e3fdeee609a564f5ae7d4d0cb753 /modules
parentDon't throw an exception when we get the kind of format of `ref` the `create` (diff)
signature
Use `rpartition` to either get the last part of a `ref/head/branch` ref or just
`branch` (github)
Diffstat (limited to 'modules')
-rw-r--r--modules/github/module.py5
1 files changed, 1 insertions, 4 deletions
diff --git a/modules/github/module.py b/modules/github/module.py
index 6085face..7629af76 100644
--- a/modules/github/module.py
+++ b/modules/github/module.py
@@ -250,10 +250,7 @@ class Module(ModuleManager.BaseModule):
branch = None
if "ref" in data:
- if "/" in data["ref"]:
- branch = data["ref"].split("/", 2)[2]
- else:
- branch = data["ref"]
+ _, _, branch = data["ref"].rpartition("/")
hooks = self.bot.database.channel_settings.find_by_setting(
"github-hooks")