Don't throw an exception when we get the kind of format of ref the create

event gives (only repo name, not `"refs/head/repo"`) (github)
This commit is contained in:
jesopo 2019-01-23 08:50:14 +00:00
parent e45b72356c
commit fcbb530b9e

View file

@ -250,7 +250,10 @@ class Module(ModuleManager.BaseModule):
branch = None
if "ref" in data:
branch = data["ref"].split("/", 2)[2]
if "/" in data["ref"]:
branch = data["ref"].split("/", 2)[2]
else:
branch = data["ref"]
hooks = self.bot.database.channel_settings.find_by_setting(
"github-hooks")