##// END OF EJS Templates
fixes git-protocol with
marcink -
r2052:320806ff beta
parent child Browse files
Show More
@@ -17,6 +17,7 b' news'
17 fixes
17 fixes
18 +++++
18 +++++
19
19
20 - fixed git protocol issues with repos-groups
20
21
21 1.3.1 (**2012-02-27**)
22 1.3.1 (**2012-02-27**)
22 ----------------------
23 ----------------------
@@ -25,6 +25,7 b''
25 # along with this program. If not, see <http://www.gnu.org/licenses/>.
25 # along with this program. If not, see <http://www.gnu.org/licenses/>.
26
26
27 import os
27 import os
28 import re
28 import logging
29 import logging
29 import traceback
30 import traceback
30
31
@@ -79,6 +80,9 b' from webob.exc import HTTPNotFound, HTTP'
79 log = logging.getLogger(__name__)
80 log = logging.getLogger(__name__)
80
81
81
82
83 GIT_PROTO_PAT = re.compile(r'git-upload-pack|git-receive-pack|info\/refs')
84
85
82 def is_git(environ):
86 def is_git(environ):
83 """Returns True if request's target is git server.
87 """Returns True if request's target is git server.
84 ``HTTP_USER_AGENT`` would then have git client version given.
88 ``HTTP_USER_AGENT`` would then have git client version given.
@@ -219,12 +223,16 b' class SimpleGit(BaseVCSController):'
219 try:
223 try:
220 environ['PATH_INFO'] = self._get_by_id(environ['PATH_INFO'])
224 environ['PATH_INFO'] = self._get_by_id(environ['PATH_INFO'])
221 repo_name = '/'.join(environ['PATH_INFO'].split('/')[1:])
225 repo_name = '/'.join(environ['PATH_INFO'].split('/')[1:])
226 repo_name = GIT_PROTO_PAT.split(repo_name)
227 if repo_name:
228 repo_name = repo_name[0]
229
222 if repo_name.endswith('/'):
230 if repo_name.endswith('/'):
223 repo_name = repo_name.rstrip('/')
231 repo_name = repo_name.rstrip('/')
224 except:
232 except:
225 log.error(traceback.format_exc())
233 log.error(traceback.format_exc())
226 raise
234 raise
227 repo_name = repo_name.split('/')[0]
235
228 return repo_name
236 return repo_name
229
237
230 def __get_user(self, username):
238 def __get_user(self, username):
General Comments 0
You need to be logged in to leave comments. Login now