aboutsummaryrefslogtreecommitdiff
path: root/gitosis/run_hook.py
diff options
context:
space:
mode:
authorTommi Virtanen <tv@eagain.net>2007-12-31 21:11:22 +0200
committerTommi Virtanen <tv@eagain.net>2007-12-31 21:11:22 +0200
commite495c9a66e583f009a53af865eacca3a5e7b953e (patch)
tree2b1f9d5b923160309a81e963fee1959b4b73c06d /gitosis/run_hook.py
parentAllow using fast_import for more than initial commit. (diff)
downloadgitosis-dakkar-e495c9a66e583f009a53af865eacca3a5e7b953e.tar.gz
gitosis-dakkar-e495c9a66e583f009a53af865eacca3a5e7b953e.tar.bz2
gitosis-dakkar-e495c9a66e583f009a53af865eacca3a5e7b953e.zip
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.
Diffstat (limited to 'gitosis/run_hook.py')
-rw-r--r--gitosis/run_hook.py5
1 files changed, 4 insertions, 1 deletions
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'),
)