comparison kallithea/lib/vcs/backends/git/ssh.py @ 8196:e51ad2cd400e

py3: drop the last uses of safe_str - they are no longer relevant when we don't have a separate unicode type
author Mads Kiilerich <mads@kiilerich.com>
date Thu, 26 Dec 2019 13:16:14 +0100
parents e35373106528
children 141066b8a89a
comparison
equal deleted inserted replaced
8195:e35373106528 8196:e51ad2cd400e
16 import os 16 import os
17 17
18 from kallithea.lib.hooks import log_pull_action 18 from kallithea.lib.hooks import log_pull_action
19 from kallithea.lib.utils import make_ui 19 from kallithea.lib.utils import make_ui
20 from kallithea.lib.vcs.backends.ssh import BaseSshHandler 20 from kallithea.lib.vcs.backends.ssh import BaseSshHandler
21 from kallithea.lib.vcs.utils import safe_str
22 21
23 22
24 log = logging.getLogger(__name__) 23 log = logging.getLogger(__name__)
25 24
26 25
68 if self.verb == 'git-upload-pack': # action 'pull' 67 if self.verb == 'git-upload-pack': # action 'pull'
69 # base class called set_hook_environment - action is hardcoded to 'pull' 68 # base class called set_hook_environment - action is hardcoded to 'pull'
70 log_pull_action(ui=make_ui(), repo=self.db_repo.scm_instance._repo) 69 log_pull_action(ui=make_ui(), repo=self.db_repo.scm_instance._repo)
71 else: # probably verb 'git-receive-pack', action 'push' 70 else: # probably verb 'git-receive-pack', action 'push'
72 if not self.allow_push: 71 if not self.allow_push:
73 self.exit('Push access to %r denied' % safe_str(self.repo_name)) 72 self.exit('Push access to %r denied' % self.repo_name)
74 # Note: push logging is handled by Git post-receive hook 73 # Note: push logging is handled by Git post-receive hook
75 74
76 # git shell is not a real shell but use shell inspired quoting *inside* the argument. 75 # git shell is not a real shell but use shell inspired quoting *inside* the argument.
77 # Per https://github.com/git/git/blob/v2.22.0/quote.c#L12 : 76 # Per https://github.com/git/git/blob/v2.22.0/quote.c#L12 :
78 # The path must be "'" quoted, but "'" and "!" must exit the quoting and be "\" escaped 77 # The path must be "'" quoted, but "'" and "!" must exit the quoting and be "\" escaped