ssh: remove unused git-related code

nistp521
Roman Zeyde 7 years ago
parent 91050ee64a
commit 051a3fd4ab
No known key found for this signature in database
GPG Key ID: 87CAE5FA46917CBB

@ -84,26 +84,6 @@ def create_agent_parser():
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
def serve(handler, sock_path=None, timeout=UNIX_SOCKET_TIMEOUT):
"""

Loading…
Cancel
Save