Skip to content

Instantly share code, notes, and snippets.

@co3k
Created August 21, 2015 01:39
Show Gist options
  • Save co3k/9deb67cb5eff2d0bc354 to your computer and use it in GitHub Desktop.
Save co3k/9deb67cb5eff2d0bc354 to your computer and use it in GitHub Desktop.
#!/usr/bin/env python
# coding: utf-8
import re
from subprocess import Popen, PIPE
import sys
line = sys.stdin.readline().strip()
if not line:
sys.exit(0)
(local_ref, local_sha, remote_ref, remote_sha) = line.split(' ')
matched = re.search('(develop|master)', remote_ref)
if matched:
sys.stderr.write(u'このブランチ ({0}) への push は禁止されています\n'.format(remote_ref))
sys.exit(1)
sys.exit(0)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment