Changeset - 320806ff6be2
[Not reviewed]
beta
0 2 0
Marcin Kuzminski - 14 years ago 2012-02-27 06:46:52
marcin@python-works.com
fixes git-protocol with
2 files changed with 10 insertions and 1 deletions:
0 comments (0 inline, 0 general)
docs/changelog.rst
Show inline comments
 
@@ -17,6 +17,7 @@ news
 
fixes
 
+++++
 

	
 
- fixed git protocol issues with repos-groups
 

	
 
1.3.1 (**2012-02-27**)
 
----------------------
rhodecode/lib/middleware/simplegit.py
Show inline comments
 
@@ -25,6 +25,7 @@
 
# along with this program.  If not, see <http://www.gnu.org/licenses/>.
 

	
 
import os
 
import re
 
import logging
 
import traceback
 

	
 
@@ -79,6 +80,9 @@ from webob.exc import HTTPNotFound, HTTP
 
log = logging.getLogger(__name__)
 

	
 

	
 
GIT_PROTO_PAT = re.compile(r'git-upload-pack|git-receive-pack|info\/refs')
 

	
 

	
 
def is_git(environ):
 
    """Returns True if request's target is git server.
 
    ``HTTP_USER_AGENT`` would then have git client version given.
 
@@ -219,12 +223,16 @@ class SimpleGit(BaseVCSController):
 
        try:
 
            environ['PATH_INFO'] = self._get_by_id(environ['PATH_INFO'])
 
            repo_name = '/'.join(environ['PATH_INFO'].split('/')[1:])
 
            repo_name = GIT_PROTO_PAT.split(repo_name)
 
            if repo_name:
 
                repo_name = repo_name[0]
 

	
 
            if repo_name.endswith('/'):
 
                repo_name = repo_name.rstrip('/')
 
        except:
 
            log.error(traceback.format_exc())
 
            raise
 
        repo_name = repo_name.split('/')[0]
 

	
 
        return repo_name
 

	
 
    def __get_user(self, username):
0 comments (0 inline, 0 general)