From e495c9a66e583f009a53af865eacca3a5e7b953e Mon Sep 17 00:00:00 2001 From: Tommi Virtanen Date: Mon, 31 Dec 2007 21:11:22 +0200 Subject: Make post-update hook reload config after writing it out. Without this, any changes to repository settings would only be applied after one extra (non-empty) push. Add unit test coverage for the post-update hook. Make SSH authorized_keys path configurable, mostly for unit tests. --- gitosis/run_hook.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'gitosis/run_hook.py') diff --git a/gitosis/run_hook.py b/gitosis/run_hook.py index f9a009d..e535e6a 100644 --- a/gitosis/run_hook.py +++ b/gitosis/run_hook.py @@ -29,6 +29,8 @@ def post_update(cfg, git_dir): os.path.join(export, 'gitosis.conf'), os.path.join(export, '..', 'gitosis.conf'), ) + # re-read config to get up-to-date settings + cfg.read(os.path.join(export, '..', 'gitosis.conf')) gitweb.set_descriptions( config=cfg, ) @@ -40,8 +42,9 @@ def post_update(cfg, git_dir): gitdaemon.set_export_ok( config=cfg, ) + authorized_keys = util.getSSHAuthorizedKeysPath(config=cfg) ssh.writeAuthorizedKeys( - path=os.path.expanduser('~/.ssh/authorized_keys'), + path=authorized_keys, keydir=os.path.join(export, 'keydir'), ) -- cgit v1.2.3