From 051a3fd4ab3d26555449315930ae0fe2062523f9 Mon Sep 17 00:00:00 2001 From: Roman Zeyde Date: Sat, 6 May 2017 20:40:23 +0300 Subject: [PATCH] ssh: remove unused git-related code --- libagent/ssh/__init__.py | 20 -------------------- 1 file changed, 20 deletions(-) diff --git a/libagent/ssh/__init__.py b/libagent/ssh/__init__.py index 7918f24..67fed4f 100644 --- a/libagent/ssh/__init__.py +++ b/libagent/ssh/__init__.py @@ -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.*?)@(?P.*?):(?P.*)', url) - if match: - return '{user}@{host}'.format(**match.groupdict()) - - @contextlib.contextmanager def serve(handler, sock_path=None, timeout=UNIX_SOCKET_TIMEOUT): """