summaryrefslogtreecommitdiffstats
path: root/main.py
diff options
context:
space:
mode:
authorMike Frysinger <vapier@google.com>2021-05-05 15:53:03 -0400
committerMike Frysinger <vapier@google.com>2021-05-06 19:09:16 +0000
commit5291eafa412117b80ebbf645fc51559dd0b2caaf (patch)
treef92dd1030f36cbf8aaa3c208bee7b94cd9c72927 /main.py
parent8e768eaaa722a99405f6542ac718880c8c22f060 (diff)
downloadgit-repo-5291eafa412117b80ebbf645fc51559dd0b2caaf.tar.gz
ssh: move all ssh logic to a common place
We had ssh logic sprinkled between two git modules, and neither was quite the right home for it. This largely moves the logic as-is to its new home. We'll leave major refactoring to followup commits. Bug: https://crbug.com/gerrit/12389 Change-Id: I300a8f7dba74f2bd132232a5eb1e856a8490e0e9 Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/305483 Reviewed-by: Chris Mcdonald <cjmcdonald@google.com> Tested-by: Mike Frysinger <vapier@google.com>
Diffstat (limited to 'main.py')
-rwxr-xr-xmain.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/main.py b/main.py
index 8aba2ec2..96744335 100755
--- a/main.py
+++ b/main.py
@@ -39,7 +39,7 @@ from color import SetDefaultColoring
39import event_log 39import event_log
40from repo_trace import SetTrace 40from repo_trace import SetTrace
41from git_command import user_agent 41from git_command import user_agent
42from git_config import init_ssh, close_ssh, RepoConfig 42from git_config import RepoConfig
43from git_trace2_event_log import EventLog 43from git_trace2_event_log import EventLog
44from command import InteractiveCommand 44from command import InteractiveCommand
45from command import MirrorSafeCommand 45from command import MirrorSafeCommand
@@ -56,6 +56,7 @@ from error import RepoChangedException
56import gitc_utils 56import gitc_utils
57from manifest_xml import GitcClient, RepoClient 57from manifest_xml import GitcClient, RepoClient
58from pager import RunPager, TerminatePager 58from pager import RunPager, TerminatePager
59import ssh
59from wrapper import WrapperPath, Wrapper 60from wrapper import WrapperPath, Wrapper
60 61
61from subcmds import all_commands 62from subcmds import all_commands
@@ -592,7 +593,7 @@ def _Main(argv):
592 repo = _Repo(opt.repodir) 593 repo = _Repo(opt.repodir)
593 try: 594 try:
594 try: 595 try:
595 init_ssh() 596 ssh.init()
596 init_http() 597 init_http()
597 name, gopts, argv = repo._ParseArgs(argv) 598 name, gopts, argv = repo._ParseArgs(argv)
598 run = lambda: repo._Run(name, gopts, argv) or 0 599 run = lambda: repo._Run(name, gopts, argv) or 0
@@ -604,7 +605,7 @@ def _Main(argv):
604 else: 605 else:
605 result = run() 606 result = run()
606 finally: 607 finally:
607 close_ssh() 608 ssh.close()
608 except KeyboardInterrupt: 609 except KeyboardInterrupt:
609 print('aborted by user', file=sys.stderr) 610 print('aborted by user', file=sys.stderr)
610 result = 1 611 result = 1