未验证 提交 e4fe4bae 编写于 作者: M Mislav Marohnić 提交者: GitHub

Merge pull request #2096 from github/no-command

Fix compatibility with git when run with no arguments
......@@ -65,7 +65,10 @@ func (r *Runner) Execute(cliArgs []string) error {
return err
}
gitArgs := []string{args.Command}
gitArgs := []string{}
if args.Command != "" {
gitArgs = append(gitArgs, args.Command)
}
gitArgs = append(gitArgs, args.Params...)
return git.Run(gitArgs...)
......
......@@ -31,3 +31,8 @@ Feature: git-hub compatibility
Scenario: Doesn't sabotage --exec-path
When I successfully run `hub --exec-path`
Then the output should not contain "These GitHub commands"
Scenario: Shows help with --git-dir
When I run `hub --git-dir=.git`
Then the exit status should be 1
And the output should contain "usage: git "
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册