summaryrefslogtreecommitdiffstats
path: root/main.py
diff options
context:
space:
mode:
authorMike Frysinger <vapier@google.com>2020-02-25 15:12:37 -0500
committerDavid Pursehouse <dpursehouse@collab.net>2020-03-17 00:08:52 +0000
commitd3639c53d56feaea81474ffd28395a124744dab7 (patch)
treee48227c75bb55a08c342f0a2d8e6ced9cadad5a7 /main.py
parentf725e548db17281037d794f18aab3320d2580865 (diff)
downloadgit-repo-d3639c53d56feaea81474ffd28395a124744dab7.tar.gz
subcmds: centralize all_commands logic
The branch->branches alias is setup in the main module when that really belongs in the existing all_commands setup. For help, rather than monkey patching all_commands to the class, switch it to use the state directly from the module. This makes it a bit more obvious where it's coming from rather than this one subcommand having a |commands| member added externally to it. Change-Id: I0200def09bf4774cad8012af0f4ae60ea3089dc0 Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/259153 Tested-by: Mike Frysinger <vapier@google.com> Reviewed-by: David Pursehouse <dpursehouse@collab.net>
Diffstat (limited to 'main.py')
-rwxr-xr-xmain.py2
1 files changed, 0 insertions, 2 deletions
diff --git a/main.py b/main.py
index 98234cbf..b309fad3 100755
--- a/main.py
+++ b/main.py
@@ -135,8 +135,6 @@ class _Repo(object):
135 def __init__(self, repodir): 135 def __init__(self, repodir):
136 self.repodir = repodir 136 self.repodir = repodir
137 self.commands = all_commands 137 self.commands = all_commands
138 # add 'branch' as an alias for 'branches'
139 all_commands['branch'] = all_commands['branches']
140 138
141 def _ParseArgs(self, argv): 139 def _ParseArgs(self, argv):
142 """Parse the main `repo` command line options.""" 140 """Parse the main `repo` command line options."""