From 70dbe1dfca34f678bc227c73bef480baf6d9c23c Mon Sep 17 00:00:00 2001 From: Tommi Virtanen Date: Sun, 2 Sep 2007 13:42:55 -0700 Subject: Make repository autocreate add .git extension. --- gitosis/test/test_serve.py | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) (limited to 'gitosis/test/test_serve.py') diff --git a/gitosis/test/test_serve.py b/gitosis/test/test_serve.py index bbffe16..846d720 100644 --- a/gitosis/test/test_serve.py +++ b/gitosis/test/test_serve.py @@ -136,5 +136,23 @@ def test_push_inits_if_needed(): user='jdoe', command="git-receive-pack 'foo'", ) - eq(os.listdir(tmp), ['foo']) - assert os.path.isfile(os.path.join(tmp, 'foo', 'HEAD')) + eq(os.listdir(tmp), ['foo.git']) + assert os.path.isfile(os.path.join(tmp, 'foo.git', 'HEAD')) + +def test_push_inits_if_needed_haveExtension(): + # a push to a non-existent repository (but where config authorizes + # you to do that) will create the repository on the fly + 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') + got = serve.serve( + cfg=cfg, + user='jdoe', + command="git-receive-pack 'foo.git'", + ) + eq(os.listdir(tmp), ['foo.git']) + assert os.path.isfile(os.path.join(tmp, 'foo.git', 'HEAD')) -- cgit v1.2.3