Skip to content

Commit 74602ce

Browse files
committed
Don't treat a branch ends with '/master' as master
Fixes #9.
1 parent 010e9c6 commit 74602ce

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

tarantoolbot.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,8 @@ def index_post():
226226
return 'Event "{}" is not needed.'.format(t)
227227
elif t == 'push':
228228
repo = r['repository']
229-
branch = r['ref'].split('/')[-1]
229+
# Strip 'refs/heads/' from beginning.
230+
branch = '/'.join(r['ref'].split('/')[2:])
230231
is_master_push = repo['master_branch'] == branch
231232
for c in r['commits']:
232233
process_commit(c, is_master_push)

0 commit comments

Comments
 (0)