aboutsummaryrefslogtreecommitdiff
path: root/gitosis/serve.py
diff options
context:
space:
mode:
Diffstat (limited to 'gitosis/serve.py')
-rw-r--r--gitosis/serve.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/gitosis/serve.py b/gitosis/serve.py
index 2b7e7da..82976c8 100644
--- a/gitosis/serve.py
+++ b/gitosis/serve.py
@@ -10,6 +10,7 @@ import sys, os, optparse, re
from ConfigParser import RawConfigParser
from gitosis import access
+from gitosis import repository
def die(msg):
print >>sys.stderr, '%s: %s' % (sys.argv[0], msg)
@@ -106,6 +107,13 @@ def serve(
# didn't have write access and tried to write
raise WriteAccessDenied()
+ if (not os.path.exists(newpath)
+ 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
+ repository.init(path=newpath)
+
# put the verb back together with the new path
newcmd = "%(verb)s '%(newpath)s'" % dict(
verb=verb,