summaryrefslogtreecommitdiffstats
path: root/git-interface/git-serve.py
diff options
context:
space:
mode:
authorLukas Fleischer <lfleischer@archlinux.org>2016-08-09 14:46:08 +0200
committerLukas Fleischer <lfleischer@archlinux.org>2016-08-10 20:14:17 +0200
commit936ee66f1e3e387d24f9bb4f5d00071c15c9f3bd (patch)
tree2368ff886dfa550d329948383640bf00557af813 /git-interface/git-serve.py
parentac6b09172483fae46bc643fa80da71961682965f (diff)
downloadaurweb-936ee66f1e3e387d24f9bb4f5d00071c15c9f3bd.tar.xz
Lazy-add new package bases
Create new package bases just before saving package metadata. This protects from stray package bases left behind when new packages are rejected, e.g. when the user tries to push a package that is available from the official repositories already. Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
Diffstat (limited to 'git-interface/git-serve.py')
-rwxr-xr-xgit-interface/git-serve.py5
1 files changed, 1 insertions, 4 deletions
diff --git a/git-interface/git-serve.py b/git-interface/git-serve.py
index d3a32c3..19c3ab2 100755
--- a/git-interface/git-serve.py
+++ b/git-interface/git-serve.py
@@ -145,10 +145,7 @@ if action == 'git-upload-pack' or action == 'git-receive-pack':
if not re.match(repo_regex, pkgbase):
die('{:s}: invalid repository name: {:s}'.format(action, pkgbase))
- if not pkgbase_exists(pkgbase):
- create_pkgbase(pkgbase, user)
-
- if action == 'git-receive-pack':
+ if action == 'git-receive-pack' and pkgbase_exists(pkgbase):
if not privileged and not pkgbase_has_write_access(pkgbase, user):
die('{:s}: permission denied: {:s}'.format(action, user))