diff --git a/gitosis/init.py b/gitosis/init.py index 87ad9a7..28e7871 100644 --- a/gitosis/init.py +++ b/gitosis/init.py @@ -77,6 +77,11 @@ def init_admin_repository( repository.init( 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): log.info('Making initial commit...') # ConfigParser does not guarantee order, so jump through hoops diff --git a/gitosis/test/test_repository.py b/gitosis/test/test_repository.py index 14c6764..1646e6c 100644 --- a/gitosis/test/test_repository.py +++ b/gitosis/test/test_repository.py @@ -51,6 +51,10 @@ def test_init_templates(): os.path.dirname(__file__), 'mocktemplates', ) + + # for reproducibility + os.umask(0022) + repository.init(path, template=templatedir) repository.init(path) got = readFile(os.path.join(path, 'no-confusion'))