summaryrefslogtreecommitdiffstats
path: root/scripts/git-integration/git-serve.py
diff options
context:
space:
mode:
authorLukas Fleischer <archlinux@cryptocrack.de>2015-01-06 23:28:57 +0100
committerLukas Fleischer <archlinux@cryptocrack.de>2015-01-06 23:29:35 +0100
commit02dd9c518f659b97dd0d301b975cf3887be5b7d8 (patch)
tree9fee4f236b0de05d3b7502503782bea73550291a /scripts/git-integration/git-serve.py
parente8c48e9f4c6fd033e81f54d408ca1d01f5ddb065 (diff)
downloadaur-02dd9c518f659b97dd0d301b975cf3887be5b7d8.tar.gz
aur-02dd9c518f659b97dd0d301b975cf3887be5b7d8.tar.xz
git-serve.py: Automatically create repositories
Create a fresh Git repository when cloning or pushing using a path that does not yet exist. Implements FS#43308. Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
Diffstat (limited to 'scripts/git-integration/git-serve.py')
-rwxr-xr-xscripts/git-integration/git-serve.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/scripts/git-integration/git-serve.py b/scripts/git-integration/git-serve.py
index c81887b9..800eada4 100755
--- a/scripts/git-integration/git-serve.py
+++ b/scripts/git-integration/git-serve.py
@@ -119,6 +119,8 @@ if action == 'git-upload-pack' or action == 'git-receive-pack':
if not repo_path_validate(path):
die('%s: invalid path: %s' % (action, path))
pkgbase = repo_path_get_pkgbase(path)
+ if not os.path.exists(path):
+ setup_repo(pkgbase, user)
if action == 'git-receive-pack':
if not check_permissions(pkgbase, user):
die('%s: permission denied: %s' % (action, user))