ssh: remove unused git-related code
This commit is contained in:
@@ -84,26 +84,6 @@ def create_agent_parser():
|
|||||||
return p
|
return p
|
||||||
|
|
||||||
|
|
||||||
def git_host(remote_name, attributes):
|
|
||||||
"""Extract git SSH host for specified remote name."""
|
|
||||||
try:
|
|
||||||
output = subprocess.check_output('git config --local --list'.split())
|
|
||||||
except subprocess.CalledProcessError:
|
|
||||||
return
|
|
||||||
|
|
||||||
for attribute in attributes:
|
|
||||||
name = r'remote.{0}.{1}'.format(remote_name, attribute)
|
|
||||||
matches = re.findall(re.escape(name) + '=(.*)', output)
|
|
||||||
log.debug('%r: %r', name, matches)
|
|
||||||
if not matches:
|
|
||||||
continue
|
|
||||||
|
|
||||||
url = matches[0].strip()
|
|
||||||
match = re.match('(?P<user>.*?)@(?P<host>.*?):(?P<path>.*)', url)
|
|
||||||
if match:
|
|
||||||
return '{user}@{host}'.format(**match.groupdict())
|
|
||||||
|
|
||||||
|
|
||||||
@contextlib.contextmanager
|
@contextlib.contextmanager
|
||||||
def serve(handler, sock_path=None, timeout=UNIX_SOCKET_TIMEOUT):
|
def serve(handler, sock_path=None, timeout=UNIX_SOCKET_TIMEOUT):
|
||||||
"""
|
"""
|
||||||
|
|||||||
Reference in New Issue
Block a user