Make sure admin repo post-update hook is executable

This commit is contained in:
Tommi Virtanen 2015-01-22 10:39:26 -08:00
parent dcffc1739e
commit 28dfea5f4d
2 changed files with 9 additions and 0 deletions

View file

@ -77,6 +77,11 @@ def init_admin_repository(
repository.init( repository.init(
path=git_dir, path=git_dir,
) )
# can't rely on setuptools and all kinds of distro packaging to
# have kept our templates executable, it seems
os.chmod(os.path.join(git_dir, 'hooks', 'post-update'), 0755)
if not repository.has_initial_commit(git_dir): if not repository.has_initial_commit(git_dir):
log.info('Making initial commit...') log.info('Making initial commit...')
# ConfigParser does not guarantee order, so jump through hoops # ConfigParser does not guarantee order, so jump through hoops

View file

@ -51,6 +51,10 @@ def test_init_templates():
os.path.dirname(__file__), os.path.dirname(__file__),
'mocktemplates', 'mocktemplates',
) )
# for reproducibility
os.umask(0022)
repository.init(path, template=templatedir) repository.init(path, template=templatedir)
repository.init(path) repository.init(path)
got = readFile(os.path.join(path, 'no-confusion')) got = readFile(os.path.join(path, 'no-confusion'))