diff options
author | Tommi Virtanen <tv@eagain.net> | 2007-11-18 17:50:02 +0200 |
---|---|---|
committer | Tommi Virtanen <tv@eagain.net> | 2007-11-18 17:50:02 +0200 |
commit | bda6572c92a9717c54b5a371a764e7536392715f (patch) | |
tree | 9c0f64c036e8ff2978c54d4125b18f6d17c191d0 /gitosis/test/test_serve.py | |
parent | Update TODO list. (diff) | |
download | gitosis-dakkar-bda6572c92a9717c54b5a371a764e7536392715f.tar.gz gitosis-dakkar-bda6572c92a9717c54b5a371a764e7536392715f.tar.bz2 gitosis-dakkar-bda6572c92a9717c54b5a371a764e7536392715f.zip |
When autocreating repositories on push, set git-daemon-export-ok etc.
Without this, it would need a separate push to gitosis-admin.git,
after the repository is autocreated, to get it to show up and be
anonymously usable.
Diffstat (limited to 'gitosis/test/test_serve.py')
-rw-r--r-- | gitosis/test/test_serve.py | 66 |
1 files changed, 66 insertions, 0 deletions
diff --git a/gitosis/test/test_serve.py b/gitosis/test/test_serve.py index 2372429..b842bdf 100644 --- a/gitosis/test/test_serve.py +++ b/gitosis/test/test_serve.py @@ -258,3 +258,69 @@ def test_push_inits_no_stdout_spam(): eq(got, '') eq(os.listdir(tmp), ['foo.git']) assert os.path.isfile(os.path.join(tmp, 'foo.git', 'HEAD')) + +def test_push_inits_sets_description(): + tmp = util.maketemp() + cfg = RawConfigParser() + cfg.add_section('gitosis') + cfg.set('gitosis', 'repositories', tmp) + cfg.add_section('group foo') + cfg.set('group foo', 'members', 'jdoe') + cfg.set('group foo', 'writable', 'foo') + cfg.add_section('repo foo') + cfg.set('repo foo', 'description', 'foodesc') + serve.serve( + cfg=cfg, + user='jdoe', + command="git-receive-pack 'foo'", + ) + eq(os.listdir(tmp), ['foo.git']) + path = os.path.join(tmp, 'foo.git', 'description') + assert os.path.exists(path) + got = util.readFile(path) + eq(got, 'foodesc\n') + +def test_push_inits_updates_projects_list(): + tmp = util.maketemp() + os.mkdir(os.path.join(tmp, 'gitosis-admin.git')) + cfg = RawConfigParser() + cfg.add_section('gitosis') + cfg.set('gitosis', 'repositories', tmp) + cfg.add_section('group foo') + cfg.set('group foo', 'members', 'jdoe') + cfg.set('group foo', 'writable', 'foo') + cfg.add_section('repo foo') + cfg.set('repo foo', 'gitweb', 'yes') + serve.serve( + cfg=cfg, + user='jdoe', + command="git-receive-pack 'foo'", + ) + eq( + sorted(os.listdir(tmp)), + sorted(['foo.git', 'gitosis-admin.git']), + ) + path = os.path.join(tmp, 'gitosis-admin.git', 'projects.list') + assert os.path.exists(path) + got = util.readFile(path) + eq(got, 'foo.git\n') + +def test_push_inits_sets_export_ok(): + tmp = util.maketemp() + cfg = RawConfigParser() + cfg.add_section('gitosis') + cfg.set('gitosis', 'repositories', tmp) + cfg.add_section('group foo') + cfg.set('group foo', 'members', 'jdoe') + cfg.set('group foo', 'writable', 'foo') + cfg.add_section('repo foo') + cfg.set('repo foo', 'daemon', 'yes') + serve.serve( + cfg=cfg, + user='jdoe', + command="git-receive-pack 'foo'", + ) + eq(os.listdir(tmp), ['foo.git']) + path = os.path.join(tmp, 'foo.git', 'git-daemon-export-ok') + assert os.path.exists(path) + |