Download:
child 175:6d53a5a4d517
parent 173:30e27c4a23c6
174:9ef694997649
Anton Shestakov <av6@dwimlabs.net>, Fri, 22 Jul 2016 10:35:41 +0800
queue: if it's git, only check "branches"

1 файлов изменено, 9 вставок(+), 4 удалений(-) [+]
hooks-queue.py file | annotate | diff | comparison | revisions
--- a/hooks-queue.py Fri Jul 22 10:29:31 2016 +0800
+++ b/hooks-queue.py Fri Jul 22 10:35:41 2016 +0800
@@ -47,10 +47,15 @@
}
changes = set()
- for change in payload['push']['changes']:
- for head in change['new'].get('heads', []):
- changes.add(head['hash'])
- changes.add(change['new']['target']['hash'])
+ if payload['repository']['scm'] == 'git':
+ for change in payload['push']['changes']:
+ if change['new']['type'] == 'branch':
+ changes.add(change['new']['name'])
+ else:
+ for change in payload['push']['changes']:
+ for head in change['new'].get('heads', []):
+ changes.add(head['hash'])
+ changes.add(change['new']['target']['hash'])
self.push(base, changes)