(t *testing.T)
| 96 | } |
| 97 | |
| 98 | func TestClientAuthenticatedCommandDefaultsToGhOnPath(t *testing.T) { |
| 99 | // Given a client without an explicit gh executable |
| 100 | client := Client{GitPath: "path/to/git"} |
| 101 | |
| 102 | // When an authenticated command is created |
| 103 | cmd, err := client.AuthenticatedCommand(t.Context(), AllMatchingCredentialsPattern, "fetch") |
| 104 | |
| 105 | // Then gh is resolved from PATH by the credential helper |
| 106 | require.NoError(t, err) |
| 107 | assert.Equal(t, []string{"path/to/git", "-c", "credential.helper=", "-c", `credential.helper=!"gh" auth git-credential`, "fetch"}, cmd.Args) |
| 108 | } |
| 109 | |
| 110 | func TestClientAuthenticatedCommandRejectsEmptyCredentialPattern(t *testing.T) { |
| 111 | // Given a client and an empty host-scoped credential pattern |
nothing calls this directly
no test coverage detected