fix(auth logout): clear credentials from git credential helper on logout by babakks · Pull Request #13450 · cli/cli · GitHub
Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 27 additions & 9 deletions pkg/cmd/auth/logout/logout.go
5 changes: 5 additions & 0 deletions pkg/cmd/auth/logout/logout_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import (
"regexp"
"testing"

"github.com/cli/cli/v2/git"
"github.com/cli/cli/v2/internal/config"
"github.com/cli/cli/v2/internal/gh"
"github.com/cli/cli/v2/internal/prompter"
Expand Down Expand Up @@ -338,6 +339,8 @@ func Test_logoutRun_tty(t *testing.T) {
}
tt.opts.Prompter = pm

tt.opts.GitClient = &git.Client{GitPath: "some/path/git"}

err := logoutRun(tt.opts)
if tt.wantErr != "" {
require.EqualError(t, err, tt.wantErr)
Expand Down Expand Up @@ -526,6 +529,8 @@ func Test_logoutRun_nontty(t *testing.T) {
ios.SetStdoutTTY(false)
tt.opts.IO = ios

tt.opts.GitClient = &git.Client{GitPath: "some/path/git"}

err := logoutRun(tt.opts)
if tt.wantErr != "" {
require.EqualError(t, err, tt.wantErr)
Expand Down
22 changes: 12 additions & 10 deletions pkg/cmd/auth/shared/gitcredentials/updater.go
Loading