[aur-dev] [PATCH] git-serve: Fix cloning with paths not starting with /

Johannes Löthberg johannes at kyriasis.com
Fri Jun 12 12:33:22 UTC 2015


Signed-off-by: Johannes Löthberg <johannes at kyriasis.com>
---
 git-interface/git-serve.py | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/git-interface/git-serve.py b/git-interface/git-serve.py
index a6dee13..85f077b 100755
--- a/git-interface/git-serve.py
+++ b/git-interface/git-serve.py
@@ -123,7 +123,9 @@ if action == 'git-upload-pack' or action == 'git-receive-pack':
         die_with_help("%s: missing path" % (action))
 
     path = cmdargv[1].rstrip('/')
-    if not path.startswith('/') or not path.endswith('.git'):
+    if not path.startswith('/'):
+        path = '/' + path
+    if not path.endswith('.git'):
         die('%s: invalid path: %s' % (action, path))
     pkgbase = path[1:-4]
     if not re.match(repo_regex, pkgbase):
-- 
2.4.2


More information about the aur-dev mailing list