diff --git a/zerver/views/webhooks.py b/zerver/views/webhooks.py index 361ce60e7e..9a3d3deb00 100644 --- a/zerver/views/webhooks.py +++ b/zerver/views/webhooks.py @@ -538,8 +538,9 @@ def api_bitbucket_webhook(request, user_profile, payload=REQ(converter=json_to_d % (payload['user'], payload['canon_url'] + repository['absolute_url'])) else: - content = build_commit_list_content(commits, payload['commits'][-1]['branch'], - None, payload['user']) + branch = payload['commits'][-1]['branch'] + content = build_commit_list_content(commits, branch, None, payload['user']) + subject += '/%s' % (branch,) subject = elide_subject(subject) check_send_message(user_profile, get_client("API"), "stream", [stream], subject, content)