only create a range url when we have commits
This commit is contained in:
parent
e0b7495ecc
commit
1e30e76cad
1 changed files with 9 additions and 5 deletions
|
@ -184,13 +184,17 @@ class GitHub(object):
|
|||
branch = utils.irc.color(branch, colors.COLOR_BRANCH)
|
||||
author = utils.irc.bold(data["pusher"]["name"])
|
||||
|
||||
first_id = data["before"]
|
||||
last_id = data["commits"][-1]["id"]
|
||||
range_url = self._short_url(
|
||||
COMMIT_RANGE_URL % (full_name, first_id, last_id))
|
||||
range_url = None
|
||||
if len(data["commits"]):
|
||||
first_id = data["before"]
|
||||
last_id = data["commits"][-1]["id"]
|
||||
range_url = self._short_url(
|
||||
COMMIT_RANGE_URL % (full_name, first_id, last_id))
|
||||
|
||||
single_url = COMMIT_URL % (full_name, "%s"),
|
||||
|
||||
return self._format_push(branch, author, data["commits"],
|
||||
data["forced"], COMMIT_URL % (full_name, "%s"), range_url)
|
||||
data["forced"], single_url, range_url)
|
||||
|
||||
def _format_push(self, branch, author, commits, forced, single_url,
|
||||
range_url):
|
||||
|
|
Loading…
Reference in a new issue