From 28dfea5f4d99601f46f7b1d24c71fe0e18c55691 Mon Sep 17 00:00:00 2001 From: Tommi Virtanen Date: Thu, 22 Jan 2015 10:39:26 -0800 Subject: [PATCH] Make sure admin repo post-update hook is executable --- gitosis/init.py | 5 +++++ gitosis/test/test_repository.py | 4 ++++ 2 files changed, 9 insertions(+) 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'))