mirror of
https://github.com/facebook/sapling.git
synced 2024-10-06 23:07:18 +03:00
githelp: don't crash when user does githelp -- git
Summary: We didn't check for sanity when the user asked for hg githelp -- git - oops. Fix the args test to catch you if you ask for help for git, as opposed to (say) git commit. Test Plan: Ran the new test cases. Reviewers: #fbhgext, ikostia Reviewed By: ikostia Differential Revision: https://phab.mercurial-scm.org/D183
This commit is contained in:
parent
d5c1c31862
commit
bb9d88ea1a
@ -67,7 +67,7 @@ def githelp(ui, repo, *args, **kwargs):
|
||||
Usage: hg githelp -- <git command>
|
||||
'''
|
||||
|
||||
if len(args) == 0:
|
||||
if len(args) == 0 or (len(args) == 1 and args[0] =='git'):
|
||||
raise error.Abort(_('missing git command - '
|
||||
'usage: hg githelp -- <git command>'))
|
||||
|
||||
|
@ -21,6 +21,16 @@
|
||||
githelp on a single command should succeed
|
||||
$ hg githelp -- commit
|
||||
hg commit
|
||||
$ hg githelp -- git commit
|
||||
hg commit
|
||||
|
||||
githelp should fail nicely if we don't give it arguments
|
||||
$ hg githelp
|
||||
abort: missing git command - usage: hg githelp -- <git command>
|
||||
[255]
|
||||
$ hg githelp -- git
|
||||
abort: missing git command - usage: hg githelp -- <git command>
|
||||
[255]
|
||||
|
||||
githelp on a command with options should succeed
|
||||
$ hg githelp -- commit -pm "abc"
|
||||
|
Loading…
Reference in New Issue
Block a user