diff options
author | Tommi Virtanen <tv@eagain.net> | 2007-09-03 19:24:04 -0700 |
---|---|---|
committer | Tommi Virtanen <tv@eagain.net> | 2007-09-03 19:24:04 -0700 |
commit | 2e068602d08643b249de1ab2bc57d1ec85645bea (patch) | |
tree | 39ea7a267902177d318dc7f97b4062d826548f2f /gitosis/serve.py | |
parent | Oops, fix bad arguments. Sadly no unit tests for this part :( (diff) | |
download | gitosis-dakkar-2e068602d08643b249de1ab2bc57d1ec85645bea.tar.gz gitosis-dakkar-2e068602d08643b249de1ab2bc57d1ec85645bea.tar.bz2 gitosis-dakkar-2e068602d08643b249de1ab2bc57d1ec85645bea.zip |
Don't git init when it's not needed.
Confusion between pathnames with extensions and without made
gitosis-serve confused when it needs to create a repository
and when not.
Diffstat (limited to 'gitosis/serve.py')
-rw-r--r-- | gitosis/serve.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/gitosis/serve.py b/gitosis/serve.py index 551ac46..92f150a 100644 --- a/gitosis/serve.py +++ b/gitosis/serve.py @@ -93,14 +93,14 @@ def serve( # didn't have write access and tried to write raise WriteAccessDenied() - if (not os.path.exists(newpath) + assert not newpath.endswith('.git'), \ + 'git extension should have been stripped: %r' % newpath + repopath = '%s.git' % newpath + if (not os.path.exists(repopath) and verb in COMMANDS_WRITE): # it doesn't exist on the filesystem, but the configuration # refers to it, we're serving a write request, and the user is # authorized to do that: create the repository on the fly - assert not newpath.endswith('.git'), \ - 'git extension should have been stripped: %r' % newpath - repopath = '%s.git' % newpath repository.init(path=repopath) # put the verb back together with the new path |