aboutsummaryrefslogtreecommitdiff
path: root/gitosis/run_hook.py
diff options
context:
space:
mode:
authorTommi Virtanen <tv@eagain.net>2007-12-31 21:11:22 +0200
committerRobin H. Johnson <robbat2@gentoo.org>2008-01-22 01:00:02 -0800
commit183f0434efdab6aa5c32944a91354c68c88eae79 (patch)
tree9c832d9b3e20435db66ec9276cf0d2f7940ef4ae /gitosis/run_hook.py
parentAllow using fast_import for more than initial commit. (diff)
downloadgitosis-dakkar-183f0434efdab6aa5c32944a91354c68c88eae79.tar.gz
gitosis-dakkar-183f0434efdab6aa5c32944a91354c68c88eae79.tar.bz2
gitosis-dakkar-183f0434efdab6aa5c32944a91354c68c88eae79.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 cc852e8..ef12310 100644
--- a/gitosis/run_hook.py
+++ b/gitosis/run_hook.py
@@ -51,9 +51,12 @@ def post_update(cfg, git_dir): #pragma: no cover
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'))
build_reposistory_data(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'),
)