Fix pr create regression (#6472)

* Revert "Refactor to use new git client (#6447)"

This reverts commit 57fbe4f317.

* Fix pr create regression
This commit is contained in:
Sam Coe 2022-10-20 12:46:23 +03:00 committed by GitHub
parent 57fbe4f317
commit 2cefb9fa59
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
44 changed files with 446 additions and 483 deletions

View file

@ -8,7 +8,6 @@ import (
"github.com/MakeNowJust/heredoc"
"github.com/cli/cli/v2/api"
"github.com/cli/cli/v2/git"
"github.com/cli/cli/v2/internal/authflow"
"github.com/cli/cli/v2/internal/ghinstance"
"github.com/cli/cli/v2/pkg/cmd/ssh-key/add"
@ -28,7 +27,6 @@ type LoginOptions struct {
IO *iostreams.IOStreams
Config iconfig
HTTPClient *http.Client
GitClient *git.Client
Hostname string
Interactive bool
Web bool
@ -65,11 +63,7 @@ func Login(opts *LoginOptions) error {
var additionalScopes []string
credentialFlow := &GitCredentialFlow{
Executable: opts.Executable,
Prompter: opts.Prompter,
GitClient: opts.GitClient,
}
credentialFlow := &GitCredentialFlow{Executable: opts.Executable, Prompter: opts.Prompter}
if opts.Interactive && gitProtocol == "https" {
if err := credentialFlow.Prompt(hostname); err != nil {
return err