Changeset - 81ff11476d16
[Not reviewed]
default
0 4 0
Andrew Shadura - 9 years ago 2016-07-12 21:47:14
andrew@shadura.me
git: make sure repository path and name are Unicode strings

This is needed for supporting latest Dulwich version, but it also works with
out supported version.
4 files changed with 6 insertions and 3 deletions:
0 comments (0 inline, 0 general)
kallithea/lib/hooks.py
Show inline comments
 
@@ -35,7 +35,7 @@ from kallithea.lib import helpers as h
 
from kallithea.lib.utils import action_logger
 
from kallithea.lib.vcs.backends.base import EmptyChangeset
 
from kallithea.lib.exceptions import HTTPLockedRC, UserCreationError
 
from kallithea.lib.utils2 import safe_str, _extract_extras
 
from kallithea.lib.utils2 import safe_str, safe_unicode, _extract_extras
 
from kallithea.model.db import Repository, User
 

	
 

	
 
@@ -390,6 +390,7 @@ def handle_git_receive(repo_path, revs, 
 
    from kallithea.lib.utils import make_ui
 
    extras = _extract_extras(env)
 

	
 
    repo_path = safe_unicode(repo_path)
 
    path, ini_name = os.path.split(extras['config'])
 
    conf = appconfig('config:%s' % ini_name, relative_to=path)
 
    load_environment(conf.global_conf, conf.local_conf, test_env=False,
kallithea/lib/middleware/pygrack.py
Show inline comments
 
@@ -34,6 +34,7 @@ from webob import Request, Response, exc
 

	
 
import kallithea
 
from kallithea.lib.vcs import subprocessio
 
from kallithea.lib.utils2 import safe_unicode
 

	
 
log = logging.getLogger(__name__)
 

	
 
@@ -86,6 +87,7 @@ class GitRepository(object):
 

	
 
        :param path:
 
        """
 
        path = safe_unicode(path)
 
        assert path.startswith('/' + self.repo_name + '/')
 
        return path[len(self.repo_name) + 2:].strip('/')
 

	
kallithea/lib/middleware/simplegit.py
Show inline comments
 
@@ -227,7 +227,7 @@ class SimpleGit(BaseVCSController):
 
        from kallithea.lib.middleware.pygrack import make_wsgi_app
 
        app = make_wsgi_app(
 
            repo_root=safe_str(self.basepath),
 
            repo_name=repo_name,
 
            repo_name=safe_unicode(repo_name),
 
            extras=extras,
 
        )
 
        return app
kallithea/lib/vcs/backends/git/repository.py
Show inline comments
 
@@ -58,7 +58,7 @@ class GitRepository(BaseRepository):
 
    def __init__(self, repo_path, create=False, src_url=None,
 
                 update_after_clone=False, bare=False):
 

	
 
        self.path = abspath(repo_path)
 
        self.path = safe_unicode(abspath(repo_path))
 
        repo = self._get_repo(create, src_url, update_after_clone, bare)
 
        self.bare = repo.bare
 

	
0 comments (0 inline, 0 general)